Rev 2417: compare_subtrees skips formats that can't do subtrees in file:///home/mbp/bzr/Work/dirstate-plus-subtree/

Martin Pool mbp at sourcefrog.net
Thu Mar 1 03:48:04 GMT 2007


------------------------------------------------------------
revno: 2417
revision-id: mbp at sourcefrog.net-20070301034802-8m8jqq0wohyyu17c
parent: mbp at sourcefrog.net-20070301034456-ck62y1icsmsp1a8n
parent: mbp at sourcefrog.net-20070227061158-thegg4xka7257q8f
committer: Martin Pool <mbp at sourcefrog.net>
branch nick: dirstate-plus-subtree
timestamp: Thu 2007-03-01 14:48:02 +1100
message:
  compare_subtrees skips formats that can't do subtrees
modified:
  bzrlib/tests/intertree_implementations/test_compare.py test_compare.py-20060724101752-09ysswo1a92uqyoz-2
    ------------------------------------------------------------
    revno: 2415.1.2
    merged: 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.
    ------------------------------------------------------------
    revno: 2415.1.1
    merged: mbp at sourcefrog.net-20070227060323-142rxg5dq06h0w8l
    parent: mbp at sourcefrog.net-20070227055136-6y8ueffopkd59lzf
    committer: Martin Pool <mbp at sourcefrog.net>
    branch nick: dirstate-plus-subtree
    timestamp: Tue 2007-02-27 17:03:23 +1100
    message:
      Remove outdated inventory doctest
=== modified file 'bzrlib/tests/intertree_implementations/test_compare.py'
--- a/bzrlib/tests/intertree_implementations/test_compare.py	2007-03-01 03:44:56 +0000
+++ b/bzrlib/tests/intertree_implementations/test_compare.py	2007-03-01 03:48:02 +0000
@@ -626,16 +626,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