~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/rename_map.py

  • Committer: Aaron Bentley
  • Date: 2009-03-15 00:02:17 UTC
  • mto: This revision was merged to the branch mainline in revision 4196.
  • Revision ID: aaron@aaronbentley.com-20090315000217-o03yrvkpnp10srdy
Add support for guessing grandparents with nonzero files.

Show diffs side-by-side

added added

removed removed

Lines of Context:
215
215
                rn.add_file_edge_hashes(basis, missing_files)
216
216
                pp.next_phase()
217
217
                matches = rn.file_match(tree, candidate_files)
218
 
                required_parents = rn.get_required_parents(matches, tree)
219
 
                matches.update(rn.match_parents(required_parents,
220
 
                               missing_parents))
 
218
                parents_matches = matches
 
219
                while len(parents_matches) > 0:
 
220
                    required_parents = rn.get_required_parents(
 
221
                        parents_matches, tree)
 
222
                    parents_matches = rn.match_parents(required_parents,
 
223
                                                       missing_parents)
 
224
                    matches.update(parents_matches)
221
225
            finally:
222
226
                task.finished()
223
 
            tree.add(set(required_parents) - set(matches))
 
227
            tree.add(required_parents)
224
228
            reversed = dict((v, k) for k, v in matches.iteritems())
225
229
            child_to_parent = sorted(
226
230
                matches.values(), key=lambda x: reversed[x], reverse=True)