Rev 3660: Clean up BzrDir.sprout (abentley) in file:///home/pqm/archives/thelove/bzr/%2Btrunk/

Canonical.com Patch Queue Manager pqm at pqm.ubuntu.com
Thu Aug 28 22:23:34 BST 2008


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

------------------------------------------------------------
revno: 3660
revision-id: pqm at pqm.ubuntu.com-20080828212328-q4mx5qgvrokx06c0
parent: pqm at pqm.ubuntu.com-20080828205415-4rzsrxmbpgujdgp2
parent: aaron at aaronbentley.com-20080828203029-g9qf4z64lssaz32r
committer: Canonical.com Patch Queue Manager <pqm at pqm.ubuntu.com>
branch nick: +trunk
timestamp: Thu 2008-08-28 22:23:28 +0100
message:
  Clean up BzrDir.sprout (abentley)
modified:
  bzrlib/branch.py               branch.py-20050309040759-e4baf4e0d046576e
  bzrlib/bzrdir.py               bzrdir.py-20060131065624-156dfea39c4387cb
    ------------------------------------------------------------
    revno: 3650.2.5
    revision-id: aaron at aaronbentley.com-20080828203029-g9qf4z64lssaz32r
    parent: aaron at aaronbentley.com-20080828144044-ezvrt8jbrgop1rdl
    committer: Aaron Bentley <aaron at aaronbentley.com>
    branch nick: sprout
    timestamp: Thu 2008-08-28 16:30:29 -0400
    message:
      Stop creating a new instance
    modified:
      bzrlib/bzrdir.py               bzrdir.py-20060131065624-156dfea39c4387cb
    ------------------------------------------------------------
    revno: 3650.2.4
    revision-id: aaron at aaronbentley.com-20080828144044-ezvrt8jbrgop1rdl
    parent: aaron at aaronbentley.com-20080827204807-f2rn8vrv57uisl1b
    parent: pqm at pqm.ubuntu.com-20080828143516-87uyghap1pw2xd1x
    committer: Aaron Bentley <aaron at aaronbentley.com>
    branch nick: sprout
    timestamp: Thu 2008-08-28 10:40:44 -0400
    message:
      Merge with bzr.dev
    modified:
      NEWS                           NEWS-20050323055033-4e00b5db738777ff
      bzrlib/btree_index.py          index.py-20080624222253-p0x5f92uyh5hw734-7
      bzrlib/chunk_writer.py         chunk_writer.py-20080630234519-6ggn4id17nipovny-1
      bzrlib/log.py                  log.py-20050505065812-c40ce11702fe5fb1
      bzrlib/plugin.py               plugin.py-20050622060424-829b654519533d69
      bzrlib/tests/test_btree_index.py test_index.py-20080624222253-p0x5f92uyh5hw734-13
      bzrlib/tests/test_chunk_writer.py test_chunk_writer.py-20080630234519-6ggn4id17nipovny-2
      bzrlib/tests/test_log.py       testlog.py-20050728115707-1a514809d7d49309
      bzrlib/tests/test_pack_repository.py test_pack_repository-20080801043947-eaw0e6h2gu75kwmy-1
      bzrlib/transport/http/_pycurl.py pycurlhttp.py-20060110060940-4e2a705911af77a6
    ------------------------------------------------------------
    revno: 3650.2.3
    revision-id: aaron at aaronbentley.com-20080827204807-f2rn8vrv57uisl1b
    parent: aaron at aaronbentley.com-20080826205846-k4oo0yvjs2ki76fe
    parent: pqm at pqm.ubuntu.com-20080827044137-4ox67ehr4bxtj7b0
    committer: Aaron Bentley <aaron at aaronbentley.com>
    branch nick: sprout
    timestamp: Wed 2008-08-27 16:48:07 -0400
    message:
      Merge from bzr.dev
    modified:
      bzrlib/_patiencediff_c.c       _patiencediff_c.c-20070721205602-q3imkipwlgagp3cy-1
      bzrlib/tests/test_diff.py      testdiff.py-20050727164403-d1a3496ebb12e339
    ------------------------------------------------------------
    revno: 3650.2.2
    revision-id: aaron at aaronbentley.com-20080826205846-k4oo0yvjs2ki76fe
    parent: aaron at aaronbentley.com-20080826203846-qqja1nmhybdpzizy
    committer: Aaron Bentley <aaron at aaronbentley.com>
    branch nick: sprout
    timestamp: Tue 2008-08-26 16:58:46 -0400
    message:
      Implement get_branch_format, to unify branch creation code
    modified:
      bzrlib/bzrdir.py               bzrdir.py-20060131065624-156dfea39c4387cb
    ------------------------------------------------------------
    revno: 3650.2.1
    revision-id: aaron at aaronbentley.com-20080826203846-qqja1nmhybdpzizy
    parent: pqm at pqm.ubuntu.com-20080826151717-xb3qgwv6xta124k7
    committer: Aaron Bentley <aaron at aaronbentley.com>
    branch nick: restore-stacking-policy
    timestamp: Tue 2008-08-26 16:38:46 -0400
    message:
      Fix sprout to honour cloning format
    modified:
      bzrlib/branch.py               branch.py-20050309040759-e4baf4e0d046576e
      bzrlib/bzrdir.py               bzrdir.py-20060131065624-156dfea39c4387cb
=== modified file 'bzrlib/branch.py'
--- a/bzrlib/branch.py	2008-08-23 15:20:30 +0000
+++ b/bzrlib/branch.py	2008-08-26 20:38:46 +0000
@@ -679,11 +679,13 @@
     @needs_read_lock
     def sprout(self, to_bzrdir, revision_id=None):
         """Create a new line of development from the branch, into to_bzrdir.
-        
+
+        to_bzrdir controls the branch format.
+
         revision_id: if not None, the revision history in the new branch will
                      be truncated to end with revision_id.
         """
-        result = self._format.initialize(to_bzrdir)
+        result = to_bzrdir.create_branch()
         self.copy_content_into(result, revision_id=revision_id)
         result.set_parent(self.bzrdir.root_transport.base)
         return result

=== modified file 'bzrlib/bzrdir.py'
--- a/bzrlib/bzrdir.py	2008-08-21 19:06:56 +0000
+++ b/bzrlib/bzrdir.py	2008-08-28 20:30:29 +0000
@@ -993,6 +993,7 @@
             try:
                 branch = self.open_branch()
                 source_repository = branch.repository
+                result_format._branch_format = branch._format
             except errors.NotBranchError:
                 source_branch = None
                 source_repository = self.open_repository()
@@ -1210,7 +1211,7 @@
 
     def create_branch(self):
         """See BzrDir.create_branch."""
-        return self.open_branch()
+        return self._format.get_branch_format().initialize(self)
 
     def destroy_branch(self):
         """See BzrDir.destroy_branch."""
@@ -1858,6 +1859,10 @@
         """See BzrDirFormat.get_format_string()."""
         return "Bazaar-NG branch, format 5\n"
 
+    def get_branch_format(self):
+        from bzrlib import branch
+        return branch.BzrBranchFormat4()
+
     def get_format_description(self):
         """See BzrDirFormat.get_format_description()."""
         return "All-in-one format 5"
@@ -1921,6 +1926,10 @@
         """See BzrDirFormat.get_format_description()."""
         return "All-in-one format 6"
 
+    def get_branch_format(self):
+        from bzrlib import branch
+        return branch.BzrBranchFormat4()
+
     def get_converter(self, format=None):
         """See BzrDirFormat.get_converter()."""
         # there is one and only one upgrade path here.




More information about the bazaar-commits mailing list