Rev 98: Fix Loom selftest with 2.0. in http://bazaar.launchpad.net/~bzr-loom-devs/bzr-loom/trunk/

Robert Collins robertc at robertcollins.net
Mon Sep 21 06:54:19 BST 2009


At http://bazaar.launchpad.net/~bzr-loom-devs/bzr-loom/trunk/

------------------------------------------------------------
revno: 98
revision-id: robertc at robertcollins.net-20090921055406-rhd5dex5wlzfapef
parent: robertc at robertcollins.net-20090618062818-l5bsw9tz497brtnl
committer: Robert Collins <robertc at robertcollins.net>
branch nick: trunk
timestamp: Mon 2009-09-21 15:54:06 +1000
message:
  Fix Loom selftest with 2.0.
=== modified file 'branch.py'
--- a/branch.py	2009-06-18 03:14:14 +0000
+++ b/branch.py	2009-09-21 05:54:06 +0000
@@ -232,7 +232,14 @@
         This differs from the base clone by cloning the loom and 
         setting the current nick to the top of the loom.
         """
-        result = self._format.initialize(to_bzrdir)
+        # If the target is a stackable repository, force-upgrade the
+        # output loom format
+        if (isinstance(to_bzrdir, bzrdir.BzrDirMeta1) and
+            to_bzrdir._format.repository_format.supports_external_lookups):
+            format = BzrBranchLoomFormat7()
+        else:
+            format = self._format
+        result = format.initialize(to_bzrdir)
         if repository_policy is not None:
             repository_policy.configure_branch(result)
         self.copy_content_into(result, revision_id=revision_id)
@@ -449,9 +456,9 @@
             return super(LoomSupport, self).pull(source,
                 overwrite=overwrite, stop_revision=stop_revision,
                 possible_transports=possible_transports,
-                _override_hook_target=_override_hook_target)
+                _override_hook_target=_override_hook_target, local=local)
         return _Puller(source, self).transfer(overwrite, stop_revision,
-            run_hooks, possible_transports, _override_hook_target)
+            run_hooks, possible_transports, _override_hook_target, local)
 
     @needs_read_lock
     def push(self, target, overwrite=False, stop_revision=None,
@@ -670,8 +677,10 @@
         return result
 
     def transfer(self, overwrite, stop_revision, run_hooks=True,
-                 possible_transports=None, _override_hook_target=None):
+        possible_transports=None, _override_hook_target=None, local=False):
         """Implementation of push and pull"""
+        if local:
+            raise bzrlib.errors.LocalRequiresBoundBranch()
         # pull the loom, and position our
         pb = bzrlib.ui.ui_factory.nested_progress_bar()
         try:




More information about the bazaar-commits mailing list