[BUG] bug in weave.join() code

John Arbash Meinel john at arbash-meinel.com
Tue Jan 24 21:43:27 GMT 2006


Robert Collins wrote:
> 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
> 

Just to post what was discussed on IRC. The current 'reweave' code
creates a set, which will destroy the original order.
So I'm planning on changing a few places so that they use sets rather
than lists.
And at the same time, I'll write a test to make sure the optimization in
Weave.join() actually works.

John
=:->

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 256 bytes
Desc: OpenPGP digital signature
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20060124/f461d27b/attachment.pgp 


More information about the bazaar mailing list