Experiences with Bazaar in a Commercial Environment

Martin Geisler mg at aragost.com
Wed Feb 22 09:49:38 UTC 2012


"Stephen J. Turnbull" <stephen at xemacs.org> writes:

> A. S. Budden writes:
>
>  > > Or, in other words: If you're deliberately allowing multiple
>  > > people to write to the same repository, I don't see how “merges
>  > > get intertwined with commits” is an issue to lay at Bazaar's
>  > > feet.
>  > 
>  > I guess I worded my discussion poorly: I didn't intend to blame
>  > Bazaar for this (I think I said that this was probably our fault
>  > for choosing a centralised model). I fully understand that this
>  > problem was with the workflow and not implicit to Bazaar.
>
> No, it *is* specific to Bazaar. Bazaar is the only major DVCS that
> encourages you to merge into a dirty workspace. In hg and git, you
> have to either commit or do something special in order to merge in a
> workspace with uncommitted work.

Actually, as long as you haven't made any commits since your last pull,
then Mercurial will allow you to use 'hg update' to merge your dirty
working copy after a 'hg pull'. Before the pull you are here:

  ... [a] --- [b] --- (wc)

where your dirty working copy is based on [b]. You pull:

  ... [a] --- [b] --- [c] --- [d]
                 \
                  (wc)

and your working copy is still at [b]. If you commit now you'll create a
small anonymous branch:

  ... [a] --- [b] --- [c] --- [d]
                 \
                  [x]

and you can merge this with [d]:

  ... [a] --- [b] --- [c] --- [d] --- [y]
                 \                   /
                  [x] --------------'

This is the recommended and robust way to go about things.

However, you can also do an update instead of a commit. You then end up
with:

  ... [a] --- [b] --- [c] --- [d] --- (wc')

where (wc') is your merge between the old (wc) and [d]. It does a full
three-way merge so you get full support for renames and merge tools.

This is similarly risky to good old SVN since you're playing around with
uncommitted changes. Even if you screw up the merge, you *can* recover
your old (uncommitted) files from (wc) with

  hg resolve --tool internal:local

This is not a very user friendly or well known feature, infact, some
old-timers swore that it didn't exist when I last mentioned it on our
mailinglist :)

-- 
Martin Geisler

aragost Trifork
Professional Mercurial support
http://www.aragost.com/mercurial/



More information about the bazaar mailing list