[MERGE][0.15] a few pointers needed for solving a bug

John Arbash Meinel john at arbash-meinel.com
Fri Mar 23 00:01:44 GMT 2007


Sabin Iacob wrote:
> John Arbash Meinel wrote:
>> If you want, send me the contents of '.bzr/checkout/dirstate'. That is
>> the file which tracks the current state of the workingtree. So I can use
>> it to figure out what it thinks is going on.
>>   
> 
> attached
> 
>> I'll take a look at it. But I'd like to make sure that you end up
>> running with the latest bzr.dev. Since it seems to have at least a
>> partial fix for this bug.
>>
>> John
>> =:->
>>   
> 
> bzr.dev r2371 (actually, not much seems to have changed since 2367)
> 

I was able to track it down (eventually). The problem is that the
detection was random, because it was indirected through a set().

Basically, what happened was "bzr mv dir/subdir subdir" would mark
'subdir' as correctly moved, and would update all children
(dir/subdir/file => subdir/file). But some of the references were
incorrect. (dir/subdir/file => subdir).

The reason it was random, was because the _get_entry() code has the
chance to look for an entry either where it was renamed from, or where
it was renamed to. If it found it at 'renamed to', then it would
succeed. If it found it at "renamed from", then it would follow the
rename pointer, and end up at the wrong location.

Fortunately, we had a check against this happening.

Anyway, the attached patch has the single line fix:
=== modified file 'bzrlib/workingtree_4.py'
--- bzrlib/workingtree_4.py     2007-03-21 04:14:35 +0000
+++ bzrlib/workingtree_4.py     2007-03-22 23:47:20 +0000
@@ -809,7 +809,7 @@
                                      size=cur_details[2],
                                      to_block=to_block,
                                      to_key=to_key,
-                                     to_path_utf8=to_rel_utf8)
+                                     to_path_utf8=to_path_utf8)
                             if minikind == 'd':
                                 # We need to move all the children of this
                                 # entry

and a bunch of updates for testing to make sure we catch this sort of thing.


This should certainly be merged for 0.15final, and I would expect it to
make 0.15rc3.

The branch is registered with Launchpad, and is also available from:
http://bzr.arbash-meinel.com/branches/bzr/0.15-dev/move_children_correctly

John
=:->

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: move_children_correctly.patch
Url: https://lists.ubuntu.com/archives/bazaar/attachments/20070322/7eba4a28/attachment-0001.diff 


More information about the bazaar mailing list