hg branch == bzr ???

Toshio Kuratomi a.badger at gmail.com
Fri Jan 18 22:01:25 GMT 2008


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.
> 
bzr branch is like hg clone or git clone in many ways.  However, when 
combined with shared repositories and the merge command it is also like 
"named branches".  To many people this makes it easier to work with as 
it lets you easily visualize that you have separate lines of development 
going on in each directory.

Here's an example of using it::

$ bzr init-repo myworkarea
$ cd myworkarea
$ bzr branch REMOTE_REPO_URL/myproject
$ bzr branch myproject myproject-typos
[...make changes, commits, etc in myproject-typos...]
$ bzr branch myproject myproject-unstable-feature
[...make changes, commits, etc in myproject-unstable-feature...]
$ cd myproject
$ bzr pull
[ bzr pull retrieves the latest changes from your remote repository]
$ bzr merge ../myproject-typos
[...resolve any conflicts...]
$ bzr commit
$ bzr merge ../myproject-unstable-feature
[...resolve any conflicts...]
$ bzr commit

Now, why are shared repositories important to this?  Shared repositories 
allow you to share revisions between your separate branches.  In this 
example the repository knows that many of the changesets for the three 
branches are held in common.  It stores those changesets a single time 
in the repository instead of once for each branch.

This gives you the best of two worlds:  branches that exist in separate 
directories and are thus easy to conceptualize and shared storage so it 
is efficient to maintain many branches in this manner.

-Toshio

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: OpenPGP digital signature
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20080118/8e7ef181/attachment-0001.pgp 


More information about the bazaar mailing list