[BUG] bug in weave.join() code

Robert Collins robertc at robertcollins.net
Tue Jan 24 21:41:06 GMT 2006


On Tue, 2006-01-24 at 14:21 -0600, John Arbash Meinel wrote:
> I found a pretty large bug in the Weave.join() code, which causes the
> code to freak out quite a bit. Specifically the code:
> 
> if name in self._names:
>     idx = self.lookup(name)
>     n1 = map(other.idx_to_name, other._parents[other_idx] )
>     n2 = map(self.idx_to_name, self._parents[other_idx] )
>     if sha1 ==  self._sha1s[idx] and n1 == n2:
>         continue
> 
> Notice that it uses other_idx instead of 'idx' so this should be:
>     n2 = map(self.idx_to_name, self._parents[idx] )
> 
> Also, in testing, I found that we still have a lot of mismatched
> parents. Specifically we have inverted parent heirarchy. For example:
> 
>  inventory merge 3189/3202 0:00:01
> version {robertc at robertcollins.net-20060121104246-604e9a6a3eb8e10b}
> present, but different parents:
> ['robertc at robertcollins.net-20060121095439-042130d88768fcb2',
> 'john at arbash-meinel.com-20060120193409-1466a4908863d28f'] vs
> ['john at arbash-meinel.com-20060120193409-1466a4908863d28f',
> 'robertc at robertcollins.net-20060121095439-042130d88768fcb2']
> All changes applied successfully.
> 
> Now this could actually be my fault. It might be caused by my
> clean-weave plugin. But auditing my code, it doesn't look like that is
> the case.

Theres a bunch of set manipulation of parents: I dont think the ordering
of the line should impact that comparison - so thats a bug ;).

Rob

-- 
GPG key available at: <http://www.robertcollins.net/keys.txt>.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20060125/01927cb4/attachment.pgp 


More information about the bazaar mailing list