Thoughts on file ids

John Arbash Meinel john at arbash-meinel.com
Wed May 18 15:11:25 UTC 2011


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1


...
> 
> I note you write 'in the past' -- I just tested renaming a directory and
> merging in a change made in the old directory and it worked the same in
> all major versions from 1.0 to 1.8.3 (I could not get Mercurial 0.9
> running on my machine). The scenario is:

The case Martin described was also:

bzr init test
cd test
mkdir dir
echo foo > dir/foo
bzr add
bzr commit -m "added dir/foo"
cd ..
bzr branch test test-rename
cd test-rename
bzr mv dir other-dir
bzr commit -m "rename dir"
cd ../test
echo bar > dir/bar
bzr add
bzr commit -m "add bar to dir"
cd ../test-rename
bzr merge ../test

'dir/bar' should appear as "other-dir/bar"

And for one further test
bzr revert
bzr mkdir dir/
echo new-dir new-file dir/something_different
bzr commit -m "new 'dir'"
bzr merge ../test

Even though "dir" now exists, "bar" was clearly added to the old "dir"
which is now named "other-dir", so "bar" should still show up as
"other-dir/bar".

It is usually those kinds of edge cases that are really hard to get
right after-the-fact. Because for performance they pretty much always
say "if X exists now, it is the same as the old X". So renaming a dir,
but then creating another one with the same name doesn't get detected.

It is an edge case, and sometimes you can argue which way is correct.
However if a user does "bzr mv dir other-dir; bzr mkdir dir" then *their
actions* indicated dir becomes other-dir.

If they wanted the other behavior they would do:
"bzr mkdir other-dir; bzr mv dir/* other-dir"


John
=:->
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk3T4Z0ACgkQJdeBCYSNAAOORwCfXCQep85znb7nk/TIsqO3kBd8
uzYAoLpGGkbvW5qNq+Ppe2siOVLfwW0D
=Bfkw
-----END PGP SIGNATURE-----



More information about the bazaar mailing list