Rev 2361: Basic implementation test that makes sure _iter_changes handles unknown files. in http://bzr.arbash-meinel.com/branches/bzr/0.15-dev/iter_changes_unicode_unknowns

John Arbash Meinel john at arbash-meinel.com
Thu Mar 15 20:51:29 GMT 2007


At http://bzr.arbash-meinel.com/branches/bzr/0.15-dev/iter_changes_unicode_unknowns

------------------------------------------------------------
revno: 2361
revision-id: john at arbash-meinel.com-20070315205112-g98xrtulgesi9kdy
parent: pqm at pqm.ubuntu.com-20070315151245-0d48a831784fc542
committer: John Arbash Meinel <john at arbash-meinel.com>
branch nick: iter_changes_unicode_unknowns
timestamp: Thu 2007-03-15 15:51:12 -0500
message:
  Basic implementation test that makes sure _iter_changes handles unknown files.
modified:
  bzrlib/tests/intertree_implementations/test_compare.py test_compare.py-20060724101752-09ysswo1a92uqyoz-2
-------------- next part --------------
=== modified file 'bzrlib/tests/intertree_implementations/test_compare.py'
--- a/bzrlib/tests/intertree_implementations/test_compare.py	2007-03-13 02:16:17 +0000
+++ b/bzrlib/tests/intertree_implementations/test_compare.py	2007-03-15 20:51:12 +0000
@@ -1051,3 +1051,38 @@
             self.deleted(tree1, 'e-id'),
             ])
         self.assertEqual(expected, self.do_iter_changes(tree1, tree2))
+
+    def test_trees_with_unknowns(self):
+        tree1 = self.make_branch_and_tree('tree1')
+        tree2 = self.make_to_branch_and_tree('tree2')
+        root_id = tree1.get_root_id()
+        tree2.set_root_id(root_id)
+        self.build_tree(['tree1/a/',
+                         'tree2/a/',
+                         'tree2/a/unknown_dir/',
+                         'tree2/a/unknown_file',
+                         'tree2/a/unknown_dir/file',
+                         'tree2/unknown_root_file',
+                        ])
+        tree1.add(['a'], ['a-id'])
+        tree2.add(['a'], ['a-id'])
+        tree1, tree2 = self.mutable_trees_to_test_trees(tree1, tree2)
+        tree1.lock_read()
+        self.addCleanup(tree1.unlock)
+        tree2.lock_read()
+        self.addCleanup(tree2.unlock)
+        expected = sorted([
+            self.unchanged(tree1, root_id),
+            self.unchanged(tree1, 'a-id'),
+            self.unversioned(tree2, 'a/unknown_dir'),
+            self.unversioned(tree2, 'a/unknown_file'),
+            self.unversioned(tree2, 'unknown_root_file'),
+            # a/unknown_dir/file should not be included because we should not
+            # recurse into unknown_dir
+            # self.unversioned(tree2, 'a/unknown_dir/file'),
+            ])
+        self.assertEqual(expected,
+                         self.do_iter_changes(tree1, tree2,
+                                              include_unchanged=True,
+                                              require_versioned=False,
+                                              want_unversioned=True))



More information about the bazaar-commits mailing list