fix for a keyerror in finding least common ancestors
Aaron Bentley
aaron.bentley at utoronto.ca
Mon Jul 30 14:16:33 BST 2007
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Michael Hudson wrote:
> I have an branch of launchpad with pretty complicated merge history.
> Attempting to merge a particular revision of launchpad head into it
> yields an exception like:
>
> Traceback (most recent call last):
> File "/home/mwh/bzr/bzrlib/commands.py", line 729, in run_bzr_catch_errors
> return run_bzr(argv)
> File "/home/mwh/bzr/bzrlib/commands.py", line 691, in run_bzr
> ret = run(*run_argv)
> File "/home/mwh/bzr/bzrlib/commands.py", line 389, in run_argv_aliases
> return self.run(**all_cmd_args)
> File "/home/mwh/bzr/bzrlib/builtins.py", line 2709, in run
> change_reporter=change_reporter)
> File "/home/mwh/bzr/bzrlib/builtins.py", line 3724, in _merge_helper
> merger.set_base(base_revision)
> File "/home/mwh/bzr/bzrlib/merge.py", line 268, in set_base
> self.base_rev_id = graph.find_unique_lca(*revisions)
> File "/home/mwh/bzr/bzrlib/graph.py", line 279, in find_unique_lca
> lca = self.find_lca(*revisions)
> File "/home/mwh/bzr/bzrlib/graph.py", line 140, in find_lca
> return self._filter_candidate_lca(border_common)
> File "/home/mwh/bzr/bzrlib/graph.py", line 244, in _filter_candidate_lca
> del active_searchers[candidate]
> KeyError: 'pqm at pqm.ubuntu.com-20070712051010-4o5ij0wgrvhvdf0o'
>
> 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.
> 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.
>, but that's not surprising as I
> spent most of that time trying to understand the terminology of this file...
I'm not really familiar with graph theory terminology. I'd appreciate
any suggestions you can offer, and I'm also happy to explain everything
in the file already.
Aaron
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQFGreSx0F+nu1YWqI0RAgbQAJ0Q85ws+wBU7r+PJsqJmjTWgyxwpACghA7v
9ZQxwmGJmd9vCj/zC+kax0s=
=ASor
-----END PGP SIGNATURE-----
More information about the bazaar
mailing list