Rev 4129: (andrew) Fix bug when pushing stackable branch in unstackable repo to in file:///home/pqm/archives/thelove/bzr/%2Btrunk/

Canonical.com Patch Queue Manager pqm at pqm.ubuntu.com
Thu Mar 12 09:17:36 GMT 2009


At file:///home/pqm/archives/thelove/bzr/%2Btrunk/

------------------------------------------------------------
revno: 4129
revision-id: pqm at pqm.ubuntu.com-20090312091731-9trx3k1cehgpwhbm
parent: pqm at pqm.ubuntu.com-20090312083815-gngp4va6p39wr31o
parent: andrew.bennetts at canonical.com-20090312074257-vx7qxv8dy654g9kp
committer: Canonical.com Patch Queue Manager <pqm at pqm.ubuntu.com>
branch nick: +trunk
timestamp: Thu 2009-03-12 09:17:31 +0000
message:
  (andrew) Fix bug when pushing stackable branch in unstackable repo to
  	default-stacking target.
modified:
  NEWS                           NEWS-20050323055033-4e00b5db738777ff
  bzrlib/bzrdir.py               bzrdir.py-20060131065624-156dfea39c4387cb
  bzrlib/tests/test_bzrdir.py    test_bzrdir.py-20060131065654-deba40eef51cf220
    ------------------------------------------------------------
    revno: 4126.1.1
    revision-id: andrew.bennetts at canonical.com-20090312074257-vx7qxv8dy654g9kp
    parent: pqm at pqm.ubuntu.com-20090312071229-wgby8yvwn51qcrbz
    committer: Andrew Bennetts <andrew.bennetts at canonical.com>
    branch nick: fix-mixed-stacking-source-formats
    timestamp: Thu 2009-03-12 17:42:57 +1000
    message:
      Fix bug when pushing stackable branch in unstackable repo to default-stacking target.
    modified:
      NEWS                           NEWS-20050323055033-4e00b5db738777ff
      bzrlib/bzrdir.py               bzrdir.py-20060131065624-156dfea39c4387cb
      bzrlib/tests/test_bzrdir.py    test_bzrdir.py-20060131065654-deba40eef51cf220
=== modified file 'NEWS'
--- a/NEWS	2009-03-12 07:01:27 +0000
+++ b/NEWS	2009-03-12 09:17:31 +0000
@@ -29,6 +29,10 @@
 
   BUG FIXES:
 
+    * Fix "is not a stackable format" error when pushing a
+      stackable-format branch with an unstackable-format repository to a
+      destination with a default stacking policy.  (Andrew Bennetts)
+
   DOCUMENTATION:
 
     * The generated manpage now explicitly lists aliases as commands.

=== modified file 'bzrlib/bzrdir.py'
--- a/bzrlib/bzrdir.py	2009-03-06 12:00:07 +0000
+++ b/bzrlib/bzrdir.py	2009-03-12 07:42:57 +0000
@@ -3062,7 +3062,8 @@
                 stack_on = self._get_full_stack_on()
         try:
             branch.set_stacked_on_url(stack_on)
-        except errors.UnstackableBranchFormat:
+        except (errors.UnstackableBranchFormat,
+                errors.UnstackableRepositoryFormat):
             if self._require_stacking:
                 raise
 

=== modified file 'bzrlib/tests/test_bzrdir.py'
--- a/bzrlib/tests/test_bzrdir.py	2009-03-10 07:41:16 +0000
+++ b/bzrlib/tests/test_bzrdir.py	2009-03-12 07:42:57 +0000
@@ -59,7 +59,7 @@
 from bzrlib.transport.memory import MemoryServer
 from bzrlib.transport.nosmart import NoSmartTransportDecorator
 from bzrlib.transport.readonly import ReadonlyTransportDecorator
-from bzrlib.repofmt import knitrepo, weaverepo
+from bzrlib.repofmt import knitrepo, weaverepo, pack_repo
 
 
 class TestDefaultFormat(TestCase):
@@ -466,6 +466,18 @@
         self.assertEqual(child_branch.base,
                          new_child.open_branch().get_stacked_on_url())
 
+    def test_default_stacking_with_stackable_branch_unstackable_repo(self):
+        # Make stackable source branch with an unstackable repo format.
+        source_bzrdir = self.make_bzrdir('source')
+        pack_repo.RepositoryFormatKnitPack1().initialize(source_bzrdir)
+        source_branch = bzrlib.branch.BzrBranchFormat7().initialize(source_bzrdir)
+        # Make a directory with a default stacking policy
+        parent_bzrdir = self.make_bzrdir('parent')
+        stacked_on = self.make_branch('parent/stacked-on', format='pack-0.92')
+        parent_bzrdir.get_config().set_default_stack_on(stacked_on.base)
+        # Clone source into directory
+        target = source_bzrdir.clone(self.get_url('parent/target'))
+
     def test_sprout_obeys_stacking_policy(self):
         child_branch, new_child_transport = self.prepare_default_stacking()
         new_child = child_branch.bzrdir.sprout(new_child_transport.base)




More information about the bazaar-commits mailing list