hg branch == bzr ???

John Arbash Meinel john at arbash-meinel.com
Fri Jan 18 22:29:36 GMT 2008


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

j w wrote:
> I've been comparing bazaar to mercurial a bit, and can someone tell me:
> what is bazaar's equivalent to mercurial's "named branches"?
> It seems to me that bzr's "branch" is analagous to hg's (and git's) "clone"
> 
> So what corresponds to the "branch" in those other tools.
> Basically, I want to have multiple lines of development in one working
> directory, and be able to switch between them.
> 
> I have searched around, skimmed bzr's docs, run the commandline help,
> but I think I am just missing the "magic keyword"...
> 
> -John
> 
> 

In general, every branch in Bazaar has a URL associated with it. You can
use other techniques like:

http://doc.bazaar-vcs.org/bzr.dev/en/user-guide/index.html#reusing-a-checkout

Where you would have a shared repository with no trees, and then a
lightweight checkout of that repository. And then you can use "bzr
switch" to switch between the named branches. Something like:

bzr init-repo --no-trees project
cd project
bzr branch $UPSTREAM upstream
bzr branch upstream mycode
bzr checkout --lightweight mycode working
cd working
<hack hack, commit, hack, etc>
bzr switch ../upstream
bzr pull # get the latest upstream, and see the changes on disk
bzr switch ../mycode
bzr merge ../upstream
bzr commit -m "merging in latest upstream"

etc.

Having branches at specific paths makes it a bit easier to see what
branches you have (ls repo, apache's default Index view shows them,
etc). We already provide shared repositories and lightweight checkouts,
so you can leverage that to re-use the working tree between multiple
branches.

John
=:->
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFHkShQJdeBCYSNAAMRAlKMAJ0TBRwi6L6XyA4e7LLsXEI9iVq1LgCgqAcj
rlb+6Bci1p29aheD/JDZNGs=
=26Ba
-----END PGP SIGNATURE-----



More information about the bazaar mailing list