Rev 4062: (mbp) fix #321695 sprouting old branches in file:///home/pqm/archives/thelove/bzr/%2Btrunk/

Canonical.com Patch Queue Manager pqm at pqm.ubuntu.com
Fri Feb 27 05:58:32 GMT 2009


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

------------------------------------------------------------
revno: 4062
revision-id: pqm at pqm.ubuntu.com-20090227055829-spbhpi4ccodki2r4
parent: pqm at pqm.ubuntu.com-20090227043310-f96id6jsevm31349
parent: mbp at sourcefrog.net-20090226060151-9cudgfte3diq8njr
committer: Canonical.com Patch Queue Manager <pqm at pqm.ubuntu.com>
branch nick: +trunk
timestamp: Fri 2009-02-27 05:58:29 +0000
message:
  (mbp) fix #321695 sprouting old branches
modified:
  NEWS                           NEWS-20050323055033-4e00b5db738777ff
  bzrlib/bzrdir.py               bzrdir.py-20060131065624-156dfea39c4387cb
    ------------------------------------------------------------
    revno: 4054.3.1
    revision-id: mbp at sourcefrog.net-20090226060151-9cudgfte3diq8njr
    parent: pqm at pqm.ubuntu.com-20090226031558-1ubr618vdn4r5f07
    committer: Martin Pool <mbp at sourcefrog.net>
    branch nick: 321695-sprout-typeerror
    timestamp: Thu 2009-02-26 17:01:51 +1100
    message:
      BzrDirPreSplitOut.sprout should accept source_branch parameter
    modified:
      NEWS                           NEWS-20050323055033-4e00b5db738777ff
      bzrlib/bzrdir.py               bzrdir.py-20060131065624-156dfea39c4387cb
=== modified file 'NEWS'
--- a/NEWS	2009-02-27 03:52:16 +0000
+++ b/NEWS	2009-02-27 05:58:29 +0000
@@ -81,6 +81,10 @@
     * Export now handles files that are not present in the tree.
       (James Westby, #174539)
 
+    * Fixed "sprout() got an unexpected keyword argument 'source_branch'"
+      error branching from old repositories.
+      (Martin Pool, #321695)
+
     * Many Branch hooks would not fire with ``bzr://`` and ``bzr+ssh://``
       branches, and this was not noticed due to a bug in the test logic
       for branches. This is now fixed and a test added to prevent it

=== modified file 'bzrlib/bzrdir.py'
--- a/bzrlib/bzrdir.py	2009-02-25 22:17:25 +0000
+++ b/bzrlib/bzrdir.py	2009-02-26 06:01:51 +0000
@@ -1341,8 +1341,15 @@
 
     def sprout(self, url, revision_id=None, force_new_repo=False,
                possible_transports=None, accelerator_tree=None,
-               hardlink=False, stacked=False, create_tree_if_local=True):
+               hardlink=False, stacked=False, create_tree_if_local=True,
+               source_branch=None):
         """See BzrDir.sprout()."""
+        if source_branch is not None:
+            my_branch = self.open_branch()
+            if source_branch.base != my_branch.base:
+                raise AssertionError(
+                    "source branch %r is not within %r with branch %r" %
+                    (source_branch, self, my_branch))
         if stacked:
             raise errors.UnstackableBranchFormat(
                 self._format, self.root_transport.base)




More information about the bazaar-commits mailing list