Bazaar Mercurial Plugin to access BitBucket

Martin Geisler mg at lazybytes.net
Thu Oct 20 18:07:30 UTC 2011


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

> Martin Geisler writes:
>
>  > You may say that about Git, for example, since it infers renames
>  > after the fact, but Mercurial tracks renames explicitly, just like
>  > Bazaar.
>
> Does Mercurial explicitly track directories (including empty
> directories)?

No, like Git, Mercurial only tracks files.

If you rename a directory (meaning: you rename all files inside a
directory to some other directory), then that is taken into account when
you merge. In particular, it means I can do

  hg rename some-dir other-dir
  hg commit

in one branch and I can do

  echo new > some-dir/new-file
  hg add
  hg commit -m 'new file'

and then new-file will correctly show up in other-dir when I merge. This
means that we really detect directory renames -- we're not just noticing
that some-dir/old-file was moved to other-dir/old-file.

While it's inferred, it works well in practice. I'm not using Bazaar
myself, but a user on the Mercurial mailinglist commented on the merge
behavior of Mercurial and Bazaar:

  Never had much of an issue there, hg's merge algorithm behaves roughly
  as well as bazaar's for me. Except Bazaar's "directory history"
  tracking tends to generate spurious and/or annoying conflicts, and
  make a mess out of everything by moving and renaming directories
  around. Especially when switching between branches adding/removing
  directories which may contain autogenerated files (e.g. .pyc files).
  To the point that I have a shortcut doing essentially `find . -name
  '*.pyc' -delete` running before every bzr switch, otherwise it breaks
  all the bloody time.

http://mercurial.markmail.org/message/jteuezx2fbrylvc4

-- 
Martin Geisler

Mercurial links: http://mercurial.ch/



More information about the bazaar mailing list