/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/tests/intertree_implementations/test_compare.py

  • Committer: John Arbash Meinel
  • Date: 2007-02-28 22:40:54 UTC
  • mto: (2255.11.3 dirstate)
  • mto: This revision was merged to the branch mainline in revision 2322.
  • Revision ID: john@arbash-meinel.com-20070228224054-11e83q8puulllfuh
Clean up test_bad_files, and fix a bug in _iter_changes when
we get to an unknown file.

Show diffs side-by-side

added added

removed removed

Lines of Context:
767
767
        expected = sorted(self.content_changed(tree2, f_id) for f_id in path_ids
768
768
                          if f_id.endswith('_f-id'))
769
769
        self.assertEqual(expected, self.do_iter_changes(tree1, tree2))
 
770
 
 
771
    def test_trees_with_unknown(self):
 
772
        tree1 = self.make_branch_and_tree('tree1')
 
773
        tree2 = self.make_to_branch_and_tree('tree2')
 
774
        self.build_tree(['tree1/a', 'tree1/c',
 
775
                         'tree2/a', 'tree2/b', 'tree2/c'])
 
776
        tree1.add(['a', 'c'], ['a-id', 'c-id'])
 
777
        tree2.add(['a', 'c'], ['a-id', 'c-id'])
 
778
 
 
779
        tree1, tree2 = self.mutable_trees_to_test_trees(tree1, tree2)
 
780
        tree1.lock_read()
 
781
        self.addCleanup(tree1.unlock)
 
782
        tree2.lock_read()
 
783
        self.addCleanup(tree2.unlock)
 
784
 
 
785
        # We should ignore the fact that 'b' exists in tree-2
 
786
        expected = sorted([
 
787
            self.content_changed(tree2, 'a-id'),
 
788
            self.content_changed(tree2, 'c-id'),
 
789
            ])
 
790
        self.assertEqual(expected, self.do_iter_changes(tree1, tree2))