fix for a keyerror in finding least common ancestors

Robert Collins robertc at robertcollins.net
Tue Jul 31 02:06:23 BST 2007


On Mon, 2007-07-30 at 09:16 -0400, Aaron Bentley wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 

> > I think the most obvious fix (attached) is actually the right fix (it's
> > not at all obvious to me that the candidate being deleted here hasn't
> > already been deleted by line 249).
> 
> I don't agree.  There's only one place that deletes an active searcher:
> line 249.  'candidate' is a key in the active_searchers dictionary, so
> there can't be two entries for
> 'pqm at pqm.ubuntu.com-20070712051010-4o5ij0wgrvhvdf0o'.
> 
> It's obvious to me that if we are walking through active_searchers, and
> we hit a StopIteration, then candidate must be present in
> active_searchers.  The fact that this can fail suggests a deeper logic
> bug, and I don't want to apply a band-aid.  I want to understand and
> solve the problem.

Agreed.

> > In a half an hour of trying, I
> > haven't been able to make a test case
> 
> That's a shame, and considering it's Launchpad, I can't just download it
> myself to reproduce.

Michael, can you do the following:
from bzrlib import branch, repository
b1 = branch.Branch.open('.')
b2 = branch.Branch.open(MERGE_SOURCE)
graph1 =
b1.repository.get_revision_graph_with_ghosts(b1.last_revision())
graph2 =
b2.repository.get_revision_graph_with_ghosts(b2.last_revision())

Now, because there are arch ids in the deep history, its possible that
there is sensitive info (such as old branch names), so check with your
manager before sending the output anywhere. But - graph1 and graph2
should be enough to hook up to the LCA logic as a test case, with a
different parent-getter routine.

If the nodes are decided to be sensitive transform them: get a flat
mapping of all the node names in both graphs, translate the data, and
then dump that. One easy format to parse is
key:parent

Or if you want to use bzrlib facilities, you can use a GraphIndex from
bzr.dev to get a serialised file Aaron or someone debugging this can
easily read.

Cheers,
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/20070731/fa7657c2/attachment.pgp 


More information about the bazaar mailing list