~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_rename_map.py

  • Committer: Aaron Bentley
  • Date: 2009-03-12 14:15:05 UTC
  • mto: This revision was merged to the branch mainline in revision 4196.
  • Revision ID: aaron@aaronbentley.com-20090312141505-9klulwvw2l0ajkh5
Improve rename detection

Show diffs side-by-side

added added

removed removed

Lines of Context:
41
41
        self.build_tree_contents([('tree/b', ''.join(self.b_lines))])
42
42
        self.assertEqual({'a': 'aid', 'b': 'bid'},
43
43
                         rn.file_match(tree, ['a', 'b']))
 
44
 
 
45
    def test_file_match_no_dups(self):
 
46
        rn = RenameMap()
 
47
        rn.add_edge_hashes(self.a_lines, 'aid')
 
48
        tree = self.make_branch_and_tree('tree')
 
49
        self.build_tree_contents([('tree/a', ''.join(self.a_lines))])
 
50
        self.build_tree_contents([('tree/b', ''.join(self.b_lines))])
 
51
        self.build_tree_contents([('tree/c', ''.join(self.b_lines))])
 
52
        self.assertEqual({'a': 'aid'},
 
53
                         rn.file_match(tree, ['a', 'b', 'c']))