~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2009-02-23 17:00:36 UTC
  • mfrom: (4032.1.4 jam-integration)
  • Revision ID: pqm@pqm.ubuntu.com-20090223170036-3q1v68ewdt8i0to5
(Marius Kruger) Remove all trailing whitespace and add tests to
        enforce this.

Show diffs side-by-side

added added

removed removed

Lines of Context:
33
33
# TODO: test items are only emitted once when a specific_files list names a dir
34
34
#       whose parent is now a child.
35
35
# TODO: test specific_files when the target tree has a file and the source a
36
 
#       dir with children, same id and same path. 
 
36
#       dir with children, same id and same path.
37
37
# TODO: test comparisons between trees with different root ids. mbp 20070301
38
38
#
39
39
# TODO: More comparisons between trees with subtrees in different states.
132
132
        self.assertEqual([], d.removed)
133
133
        self.assertEqual([], d.renamed)
134
134
        self.assertEqual([], d.unchanged)
135
 
        
 
135
 
136
136
    def test_meta_modification(self):
137
137
        tree1 = self.make_branch_and_tree('1')
138
138
        tree2 = self.make_to_branch_and_tree('2')
286
286
    def test_require_versioned(self):
287
287
        # this does not quite robustly test, as it is passing in missing paths
288
288
        # rather than present-but-not-versioned paths. At the moment there is
289
 
        # no mechanism for managing the test trees (which are readonly) to 
 
289
        # no mechanism for managing the test trees (which are readonly) to
290
290
        # get present-but-not-versioned files for trees that can do that.
291
291
        tree1 = self.make_branch_and_tree('1')
292
292
        tree2 = self.make_to_branch_and_tree('2')
293
293
        tree1 = self.get_tree_no_parents_no_content(tree1)
294
294
        tree2 = self.get_tree_no_parents_abc_content(tree2)
295
295
        tree1, tree2 = self.mutable_trees_to_test_trees(self, tree1, tree2)
296
 
        self.assertRaises(errors.PathsNotVersionedError, 
 
296
        self.assertRaises(errors.PathsNotVersionedError,
297
297
            self.intertree_class(tree1, tree2).compare,
298
298
            specific_files=['d'],
299
299
            require_versioned=True)
346
346
 
347
347
    def do_iter_changes(self, tree1, tree2, **extra_args):
348
348
        """Helper to run iter_changes from tree1 to tree2.
349
 
        
 
349
 
350
350
        :param tree1, tree2:  The source and target trees. These will be locked
351
351
            automatically.
352
352
        :param **extra_args: Extra args to pass to iter_changes. This is not
710
710
            # The locked test trees conversion could not preserve the missing
711
711
            # file status. This is normal (e.g. InterDirstateTree falls back
712
712
            # to InterTree if the basis is not a DirstateRevisionTree, and
713
 
            # revision trees cannot have missing files. 
 
713
            # revision trees cannot have missing files.
714
714
            raise TestNotApplicable()
715
715
        expected = [('file-id', ('file', None), False, (True, False),
716
716
            (root_id, None), ('file', None), (None, None), (False, None))]
787
787
 
788
788
    def test_disk_in_subtrees_skipped(self):
789
789
        """subtrees are considered not-in-the-current-tree.
790
 
        
 
790
 
791
791
        This test tests the trivial case, where the basis has no paths in the
792
792
        current trees subtree.
793
793
        """
877
877
 
878
878
    def test_unversioned_paths_in_target_matching_source_old_names(self):
879
879
        # its likely that naive implementations of unversioned file support
880
 
        # will fail if the path was versioned, but is not any more, 
 
880
        # will fail if the path was versioned, but is not any more,
881
881
        # due to a rename, not due to unversioning it.
882
882
        # That is, if the old tree has a versioned file 'foo', and
883
883
        # the new tree has the same file but versioned as 'bar', and also