[MERGE][0.16] Regression fix for 'bzr status' after delete and rename

John Arbash Meinel john at arbash-meinel.com
Thu Apr 26 00:10:04 BST 2007


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

Our WT4._iter_changes code had some bugs in it when the record was
marked as deleted, but the path was on disk.
https://bugs.beta.launchpad.net/bzr/+bug/109993

Basically, it treated the dirstate record as matching the unversioned
file on disk, but it shouldn't.

The attached patch fixes 2 bugs:

bzr init
touch a b
bzr add a b
bzr commit -m 1
bzr rm a
bzr mv b a
bzr status


The broken code would just list both files as removed.

bzr init
touch a
bzr add a
bzr commit -m 1
bzr rm --keep a
bzr status

The broken code would only list the removed 'a', without listing the
unknown file still on disk.

The bundle adds 2 tests for these 2 cases.

There is probably another way to structure it, but this one passes the
tests. (I think you could change the:

if current_entry[0][1] != current_path_info[1]:

to say

if (current_entry[0][1] != current_path_info[1]
    or current_entry[1][target_index][0] == 'a'):

Since the basic idea is that you don't want the dir block entry to match
the unversioned file on disk.

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

iD8DBQFGL9/MJdeBCYSNAAMRAoitAKDNHz4nAqPWZANo7kScLQuXd0417gCfXA2Y
hV24AiM33ynEN+hV9gD4JeU=
=feUC
-----END PGP SIGNATURE-----
-------------- next part --------------
A non-text attachment was scrubbed...
Name: rename_iter_changes_109993.patch
Type: text/x-patch
Size: 16913 bytes
Desc: not available
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20070425/1da5f0d3/attachment.bin 


More information about the bazaar mailing list