Proper tracking of file-level operations: rename, directories, merges

Stephen J. Turnbull stephen at xemacs.org
Mon Oct 24 17:09:27 UTC 2011


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.

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]

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.

Footnotes: 
[1]  Like so:

wideload:test/a 1:35$ bzr init
Created a standalone tree (format: 2a)
         
wideload:test/a 1:36$ mkdir foo
wideload:test/a 1:36$ bzr add foo
adding foo
wideload:test/a 1:36$ bzr commit -m "Added directory foo."
Committing to: /private/tmp/test/a/
         
added foo
Committed revision 1.
wideload:test/a 1:36$ cd ..
wideload:/tmp/test 1:36$ bzr branch a b
Branched 1 revision(s).
         
wideload:/tmp/test 1:36$ cd b
wideload:test/b 1:36$ bzr mv foo bar
foo => bar
wideload:test/b 1:37$ bzr commit -m "Moved foo to bar."
Committing to: /private/tmp/test/b/
         
renamed foo => bar
Committed revision 2.
wideload:test/b 1:37$ cd ../a  
wideload:test/a 1:37$ touch foo/baz
wideload:test/a 1:37$ bzr add foo/baz
adding foo/baz
wideload:test/a 1:37$ bzr commit -m "Added foo/baz."
Committing to: /private/tmp/test/a/
         
added foo/baz
Committed revision 2.
         
wideload:test/a 1:38$ cd ../b
wideload:test/b 1:38$ bzr merge ../a
+N  bar/baz
         
All changes applied successfully.
         
wideload:test/b 1:38$ bzr commit -m "Merge file added in other branch."
Committing to: /private/tmp/test/b/
         
added bar/baz
Committed revision 3.
         
wideload:test/b 1:39$ ls -R
bar

./bar:
baz
wideload:test/b 1:39$ 





More information about the bazaar mailing list