~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/graph.py

  • Committer: Aaron Bentley
  • Date: 2007-08-01 13:46:16 UTC
  • mto: This revision was merged to the branch mainline in revision 2679.
  • Revision ID: aaron.bentley@utoronto.ca-20070801134616-a3xct6wpqugrxaj3
Fix KeyError in filter_candidate_lca

Show diffs side-by-side

added added

removed removed

Lines of Context:
232
232
        active_searchers = dict(searchers)
233
233
        # skip over the actual candidate for each searcher
234
234
        for searcher in active_searchers.itervalues():
235
 
            searcher.next()
 
235
            x = searcher.next()
236
236
        while len(active_searchers) > 0:
237
 
            for candidate, searcher in list(active_searchers.iteritems()):
 
237
            for candidate in active_searchers.keys():
 
238
                try:
 
239
                    searcher = active_searchers[candidate]
 
240
                except KeyError:
 
241
                    # rare case: we deleted candidate in a previous iteration
 
242
                    # through this for loop, because it was determined to be
 
243
                    # a descendant of another candidate.
 
244
                    continue
238
245
                try:
239
246
                    ancestors = searcher.next()
240
247
                except StopIteration: