Rev 2417: test_compare_subtrees runs against all trees that claim to support in http://sourcefrog.net/bzr/dirstate-plus-subtree

Martin Pool mbp at sourcefrog.net
Tue Feb 27 06:11:59 GMT 2007


At http://sourcefrog.net/bzr/dirstate-plus-subtree

------------------------------------------------------------
revno: 2417
revision-id: mbp at sourcefrog.net-20070227061158-thegg4xka7257q8f
parent: mbp at sourcefrog.net-20070227060323-142rxg5dq06h0w8l
committer: Martin Pool <mbp at sourcefrog.net>
branch nick: dirstate-plus-subtree
timestamp: Tue 2007-02-27 17:11:58 +1100
message:
  test_compare_subtrees runs against all trees that claim to support
  references, rather than hardcoding WorkingTree4.
modified:
  bzrlib/tests/intertree_implementations/test_compare.py test_compare.py-20060724101752-09ysswo1a92uqyoz-2
=== modified file 'bzrlib/tests/intertree_implementations/test_compare.py'
--- a/bzrlib/tests/intertree_implementations/test_compare.py	2007-02-27 05:51:36 +0000
+++ b/bzrlib/tests/intertree_implementations/test_compare.py	2007-02-27 06:11:58 +0000
@@ -592,16 +592,18 @@
     def test_compare_subtrees(self):
         """want_unchanged should generate a list of unchanged entries."""
         tree1 = self.make_branch_and_tree('1')
+        if not tree1.supports_tree_reference():
+            raise tests.TestSkipped('Tree %s does not support references'
+                % (tree1,))
         tree1.set_root_id('root-id')
         subtree1 = self.make_branch_and_tree('1/sub')
         subtree1.set_root_id('subtree-id')
-        try:
-            tree1.add_reference(subtree1)
-        except errors.UnsupportedOperation:
-            self.assertIsInstance(tree1, workingtree_4.WorkingTree4)
-            raise tests.TestSkipped('Tree does not support references')
+        tree1.add_reference(subtree1)
 
         tree2 = self.make_to_branch_and_tree('2')
+        if not tree2.supports_tree_reference():
+            raise tests.TestSkipped('Tree %s does not support references'
+                % (tree2,))
         tree2.set_root_id('root-id')
         subtree2 = self.make_to_branch_and_tree('2/sub')
         subtree2.set_root_id('subtree-id')




More information about the bazaar-commits mailing list