Collocating repo and checkout
Eduardo O. Padoan
eduardo.padoan at gmail.com
Mon Apr 6 17:21:00 BST 2009
On Mon, Apr 6, 2009 at 11:14 AM, Parth Malwankar
<parth.malwankar at gmail.com> wrote:
> On Mon, 06 Apr 2009 13:34:17 +0530, Michael Homer <michael at gobolinux.org>
> wrote:
>
>> Hi,
>> For my workflow I find git's in-repository branches handy, and I've been
>> wanting
>> to make that same functionality work in Bazaar, which I otherwise prefer.
>> I've
>> been looking at writing a plugin to duplicate at least the part of them
>> that I
>> find useful. In the course of that I've found an odd trait that seems very
>> convenient, but also potentially dangerous.
>>
>> The usual multi-branch workflow for Bazaar is to have one shared
>> repository and
>> several branches within it, possibly with one of those being a lightweight
>> checkout of one of the others. By copying the "branch" and "checkout"
>> directories out of that checkout into $repo/.bzr it seems to be possible
>> to
>> have Bazaar treat the root of the repository itself as the checkout. The
>> treeless branches themselves can then be put somewhere out of the way,
>> such as
>> .bzr/local-branches, and you end up with a pretty good approximation of a
>> single multi-branch branch. Specifying the paths to switch and merge then
>> becomes a pain, but that's where the plugin would wrap things up nicely.
>>
>> I have two questions to go with that: firstly, are there any potential
>> pitfalls
>> in this setup? Clearly it's a pretty big hack, but as far as I can tell
>> from
>> testing things out nothing in Bazaar has a problem with it. Both the
>> checkout
>> and the repository go about their business in the ordinary way, without
>> any
>> interference from each other. Secondly, since it's not an intentional
>> behaviour, is it likely to continue working in the future (so I can base
>> my
>> plugin around it)?
>>
>
> There was some work done on git style branch plugin earlier
> http://article.gmane.org/gmane.comp.version-control.bazaar-ng.general/49511
>
> I haven't tried it personally.
While Jelmer's plugin is a proof of concept, there is a spec about in progress:
http://bazaar-vcs.org/DraftSpecs/ColocatedBranches
So, there are plans to support this feature on bzr. I think that If
you are interested, your feedback would be welcome by the bzr
developers.
> Regards,
> Parth
>
>
>> For clarity, here's a script of how I'm initialising this repository:
>> bzr init-repo .
>> mkdir -p .bzr/local-branches
>> cd .bzr/local-branches
>> bzr init trunk
>> cd -
>> bzr checkout --lightweight .bzr/local-branches/trunk sandbox
>> cp -R sandbox/.bzr/{branch,checkout} .bzr
>> rm -rf sandbox
>>
>> From that point on the root of the repository acts as a checkout, and you
>> can
>> create new branches and switch between them without issue. It avoids
>> polluting
>> .. with extra directories, which sometimes isn't an option for what I'm
>> working on (such as live copies of scripts in the system). Storing the
>> repository elsewhere and using a checkout live would also work, but
>> probably
>> couldn't be wrapped up in a generic way.
>> -Michael
>
>
>
> --
> Using Opera's revolutionary e-mail client: http://www.opera.com/mail/
>
>
>
--
Eduardo de Oliveira Padoan
http://importskynet.blogspot.com
http://djangopeople.net/edcrypt/
"Distrust those in whom the desire to punish is strong."
-- Goethe, Nietzsche, Dostoevsky
More information about the bazaar
mailing list