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

Wouter van Heyst larstiq at larstiq.dyndns.org
Fri Mar 23 21:14:06 GMT 2007

On Thu, Mar 22, 2007 at 07:01:44PM -0500, John Arbash Meinel wrote:
> 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

+1 for correctness. It does seem dirstate._validate() gets called a lot
more often than the docstring "This can be useful in debugging; it
shouldn't be necessary in normal code." suggests, is one of the two out
of sync?

Wouter van Heyst

More information about the bazaar mailing list