Proper tracking of file-level operations: rename, directories, merges (was: Bazaar Mercurial Plugin to access BitBucket)
Ben Finney
ben+bazaar at benfinney.id.au
Thu Oct 20 21:57:00 UTC 2011
Martin Geisler <mg at aragost.com> writes:
> Ben Finney <ben+bazaar at benfinney.id.au> writes:
>
> > * Proper tracking of all changes in the history, including renames and
> > merges.
>
> Please stop implying that Mercurial has "improper" tracking of
> changes. You may say that about Git, for example, since it infers
> renames after the fact, but Mercurial tracks renames explicitly, just
> like Bazaar.
Not of directories, it doesn't.
> I'll keep protesting until you demonstrate a bug in the handling of
> renames and merges in Mercurial.
Mercurial:
=====
$ mkdir foo/
$ for f in spam eggs beans ; do printf 'Lorem ipsum\n' > foo/$f ; done
$ hg add foo/
adding foo/beans
adding foo/eggs
adding foo/spam
$ hg commit
$ hg mv foo bar
moving foo/beans to bar/beans
moving foo/eggs to bar/eggs
moving foo/spam to bar/spam
$ printf 'Lorem morit ipsum\n' > bar/eggs
$ hg status
A bar/beans
A bar/eggs
A bar/spam
R foo/beans
R foo/eggs
R foo/spam
=====
Bazaar:
=====
$ mkdir foo/
$ for f in spam eggs beans ; do printf 'Lorem ipsum\n' > foo/$f ; done
$ bzr add foo/
adding foo
adding foo/beans
adding foo/eggs
adding foo/spam
$ bzr commit
Committing to: /home/bignose/Projects/rename-test.bzr/
added foo
added foo/beans
added foo/eggs
added foo/spam
Committed revision 1.
$ bzr mv foo bar
foo => bar
$ printf 'Lorem morit ipsum\n' > bar/eggs
$ bzr status
renamed:
foo/ => bar/
modified:
bar/eggs
=====
I consider it a bug that the file-level change made (rename ‘foo’ to
‘bar’) is not reflected as such in Mercurial, but instead pretends that
some files were added and others removed.
Bazaar tracks the rename as a rename, regardless of any other changes
made in the same revision. Hence it doesn't need to infer it after the
fact, and can present it as such in any query about the revision.
--
\ “See, in my line of work you gotta keep repeating things over |
`\ and over and over again, for the truth to sink in; to kinda |
_o__) catapult the propaganda.” —George W. Bush, 2005-05 |
Ben Finney
More information about the bazaar
mailing list