Rev 3914: Fixed as per John's review and Andrew inputs. in file:///net/bigmamac/Volumes/home/vila/src/bzr/experimental/selftest-stacking/

Vincent Ladeuil v.ladeuil+lp at free.fr
Fri Dec 19 08:50:36 GMT 2008


At file:///net/bigmamac/Volumes/home/vila/src/bzr/experimental/selftest-stacking/

------------------------------------------------------------
revno: 3914
revision-id: v.ladeuil+lp at free.fr-20081219085034-35yovefdjuqcmtvz
parent: v.ladeuil+lp at free.fr-20081218142401-m1wr8r70u051aym6
committer: Vincent Ladeuil <v.ladeuil+lp at free.fr>
branch nick: selftest-stacking
timestamp: Fri 2008-12-19 09:50:34 +0100
message:
  Fixed as per John's review and Andrew inputs.
  
  * bzrlib/tests/branch_implementations/test_stacking.py:
  (TestStacking.test_stack_on_repository_branch): Change reverted,
  jam was uncomfortable about it.
  
  * bzrlib/tests/branch_implementations/test_push.py:
  (TestPush.test_push_with_default_stacking_does_not_create_broken_branch):
  the test is right (thanks to spiv explanations), revert the
  modification.
-------------- next part --------------
=== modified file 'bzrlib/tests/branch_implementations/test_push.py'
--- a/bzrlib/tests/branch_implementations/test_push.py	2008-12-18 13:34:25 +0000
+++ b/bzrlib/tests/branch_implementations/test_push.py	2008-12-19 08:50:34 +0000
@@ -187,9 +187,8 @@
         default for the branch), and will be stacked when the repo format
         allows (which means that the branch format isn't necessarly preserved).
         """
-        if not self.branch_format.supports_stacking():
-            raise tests.TestNotApplicable('%r does not support stacking'
-                                    % self.branch_format)
+        if isinstance(self.branch_format, branch.BzrBranchFormat4):
+            raise tests.TestNotApplicable('Not a metadir format.')
         if isinstance(self.branch_format, branch.BranchReferenceFormat):
             # This test could in principle apply to BranchReferenceFormat, but
             # make_branch_builder doesn't support it.

=== modified file 'bzrlib/tests/branch_implementations/test_stacking.py'
--- a/bzrlib/tests/branch_implementations/test_stacking.py	2008-12-18 12:55:28 +0000
+++ b/bzrlib/tests/branch_implementations/test_stacking.py	2008-12-19 08:50:34 +0000
@@ -267,7 +267,8 @@
             target = source.bzrdir.sprout('target').open_branch()
             self.assertEqual('../stack-on', target.get_stacked_on_url())
         except errors.UnstackableBranchFormat, e:
-            raise TestNotApplicable(e)
+            raise TestNotApplicable('%r does not support stacking'
+                                    % self.branch_format)
 
     def test_clone_stacking_policy_handling(self):
         """Obey policy where possible, ignore otherwise."""
@@ -279,7 +280,8 @@
             target = source.bzrdir.clone('target').open_branch()
             self.assertEqual('../stack-on', target.get_stacked_on_url())
         except errors.UnstackableBranchFormat, e:
-            raise TestNotApplicable(e)
+            raise TestNotApplicable('%r does not support stacking'
+                                    % self.branch_format)
 
     def prepare_stacked_on_fetch(self):
         stack_on = self.make_branch_and_tree('stack-on')
@@ -418,7 +420,10 @@
             raise TestNotApplicable()
         # Avoid make_branch, which produces standalone branches.
         bzrdir = self.make_bzrdir('repo/stack-on')
-        b = bzrdir.create_branch()
+        try:
+            b = bzrdir.create_branch()
+        except errors.UninitializableFormat:
+            raise TestNotApplicable()
         transport = self.get_transport('stacked')
         b.bzrdir.clone_on_transport(transport, stacked_on=b.base)
         # Ensure that opening the branch doesn't raise.



More information about the bazaar-commits mailing list