Bug while moving directories
Aaron Bentley
aaron.bentley at utoronto.ca
Mon Aug 15 22:11:05 BST 2005
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Gustavo Niemeyer wrote:
> In the case I'm following, the parent directory has changed, but
> from_dir and to_dir are both '.'
At first glance, this doesn't look right.
'.' is the tree root. from_dir and to_dir are the parent directories.
If they are both '.', then either the file has not moved, or the tree
root has moved, and the file has been moved from the old root to the new
root. Moving the tree root is not currently supported, so that should
produce assertion failures.
The code does look buggy to me, but the bug is that if you do
$ bzr init
$ mkdir foo
$ touch foo/bar
$ bzr add .
$ bzr commit
$ bzr rename foo baz
$ mkdir foo
$ bzr add .
$ bzr rename baz/bar foo/bar
Then it won't recognize that the current foo is different from the
original foo.
The above should be fixable by using from_parent and to_parent instead
of from_dir and to_dir.
> so the move doesn't happen, and
> the rename ends up moving the entry back to its original place.
>
> Disabling the first part of the if makes the merge work as expected.
>
> Is that the right thing to do (I'm still finding my way
> through the code)?
It doesn't sound quite right, because it will produce false moves. When
a parent is renamed, the children should not be considered moved.
Could you test it with http://panoramicfeedback.com/opensource/bzr.24 ?
And if there's a problem, steps to reproduce (like I gave above) or a
test case would be very helpful.
Aaron
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org
iD8DBQFDAQTp0F+nu1YWqI0RAqNSAJ4/oeX8jKxPtKus7LDQ/cNDAT8WJgCeK0Vu
UL17dxlEL3r2m5C2Xcichkg=
=6Zvk
-----END PGP SIGNATURE-----
More information about the bazaar
mailing list