Proper tracking of file-level operations: rename, directories, merges
Martin Geisler
mg at lazybytes.net
Mon Oct 24 20:35:47 UTC 2011
"Stephen J. Turnbull" <stephen at xemacs.org> writes:
> John Yates writes:
>
>> No, I philosophically do not believe this is the proper user
>> experience. It reveals a fundamentally command-line-centric design in
>> which users are expected to keep in mind at all time that they are
>> using a version control system and therefore to modify their behavior
>> appropriately. From that perspective "bzr mv --after" is an even more
>> egregious UI mistake.
>
> That's find, but it's not your place to make that decision for Ben,
> any more than it is Ben's place to decide that Mercurial's way of
> doing things is a bug. I wish people would stop using words like
> "proper" and "bug" in this context.
If Mercurial fails to use the information it has to merge correctly,
then I would call it a bug. That it displays less than optimal output in
case of a rename is not a bug.
> AIUI, Ben has a requirement that renames be tracked and reported
> explicitly, including directories, and including empty directories.
> AFAICS, Mercurial can't do this, because it doesn't explicitly track
> directories:
>
> wideload:/tmp/test 1:25$ mkdir a
> wideload:/tmp/test 1:25$ cd a
> wideload:test/a 1:25$ hg init
> wideload:test/a 1:25$ mkdir foo
> wideload:test/a 1:25$ hg add foo
> wideload:test/a 1:25$ hg commit -m "Added directory foo."
> nothing changed
> wideload:test/a 1:26$ hg status
> wideload:test/a 1:27$
>
> bzr can do it.[1]
Yes, you cannot track an empty directory with Mercurial. The Bazaar
example you gave shows that Bazaar can track empty directories and that
it can merge correctly when you add a new file to foo/ before renaming
foo/ to bar/. Very handy!
Note that Mercurial handles this case *exactly the same*. I often see
people argue that "Mercurial doesn't track directories" => "Mercurial
will be bad at merging" but this does not follow. This very scenario is
a counter-example: it shows that it's not necessary to explicitly track
directories to handle a rename of foo/ to bar/.
> Ben's requirement is neither right nor wrong, it just is. And
> Mercurial's behavior is not a bug (unless the Mercurial devs have
> specified that empty directories can be tracked). It's simply the
> case that Mercurial doesn't meet one of Ben's requirements.
Yeah -- if you require renames to be reported as elegantly as Bazaar,
then we fail that requirement.
--
Martin Geisler
Mercurial links: http://mercurial.ch/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: not available
URL: <https://lists.ubuntu.com/archives/bazaar/attachments/20111024/f7ae620c/attachment.pgp>
More information about the bazaar
mailing list