Rev 6510: Merge the fix for having RemoteBranchFormat.initialize(local_bzrdir) properly in http://bazaar.launchpad.net/~jameinel/bzr/2.5-remote-wt-tests-1046697

John Arbash Meinel john at arbash-meinel.com
Thu Sep 6 08:25:45 UTC 2012


At http://bazaar.launchpad.net/~jameinel/bzr/2.5-remote-wt-tests-1046697

------------------------------------------------------------
revno: 6510 [merge]
revision-id: john at arbash-meinel.com-20120906082520-e8tv3gf07rfr9754
parent: john at arbash-meinel.com-20120906080521-wps0xwo64iea7fph
parent: john at arbash-meinel.com-20120906081947-osxnk7uxls1i76og
committer: John Arbash Meinel <john at arbash-meinel.com>
branch nick: 2.5-remote-wt-tests-1046697
timestamp: Thu 2012-09-06 12:25:20 +0400
message:
  Merge the fix for having RemoteBranchFormat.initialize(local_bzrdir) properly
  share the repository object that is passed in.
modified:
  bzrlib/remote.py               remote.py-20060720103555-yeeg2x51vn0rbtdp-1
-------------- next part --------------
=== modified file 'bzrlib/remote.py'
--- a/bzrlib/remote.py	2012-01-28 00:56:56 +0000
+++ b/bzrlib/remote.py	2012-09-06 08:19:47 +0000
@@ -3129,7 +3129,8 @@
         return a_bzrdir.open_branch(name=name, 
             ignore_fallbacks=ignore_fallbacks)
 
-    def _vfs_initialize(self, a_bzrdir, name, append_revisions_only):
+    def _vfs_initialize(self, a_bzrdir, name, append_revisions_only,
+                        repository=None):
         # Initialisation when using a local bzrdir object, or a non-vfs init
         # method is not available on the server.
         # self._custom_format is always set - the start of initialize ensures
@@ -3137,11 +3138,13 @@
         if isinstance(a_bzrdir, RemoteBzrDir):
             a_bzrdir._ensure_real()
             result = self._custom_format.initialize(a_bzrdir._real_bzrdir,
-                name=name, append_revisions_only=append_revisions_only)
+                name=name, append_revisions_only=append_revisions_only,
+                repository=repository)
         else:
             # We assume the bzrdir is parameterised; it may not be.
             result = self._custom_format.initialize(a_bzrdir, name=name,
-                append_revisions_only=append_revisions_only)
+                append_revisions_only=append_revisions_only,
+                repository=repository)
         if (isinstance(a_bzrdir, RemoteBzrDir) and
             not isinstance(result, RemoteBranch)):
             result = RemoteBranch(a_bzrdir, a_bzrdir.find_repository(), result,
@@ -3164,11 +3167,13 @@
         # Being asked to create on a non RemoteBzrDir:
         if not isinstance(a_bzrdir, RemoteBzrDir):
             return self._vfs_initialize(a_bzrdir, name=name,
-                append_revisions_only=append_revisions_only)
+                append_revisions_only=append_revisions_only,
+                repository=repository)
         medium = a_bzrdir._client._medium
         if medium._is_remote_before((1, 13)):
             return self._vfs_initialize(a_bzrdir, name=name,
-                append_revisions_only=append_revisions_only)
+                append_revisions_only=append_revisions_only,
+                repository=repository)
         # Creating on a remote bzr dir.
         # 2) try direct creation via RPC
         path = a_bzrdir._path_for_remote_call(a_bzrdir._client)
@@ -3182,7 +3187,8 @@
             # Fallback - use vfs methods
             medium._remember_remote_is_before((1, 13))
             return self._vfs_initialize(a_bzrdir, name=name,
-                    append_revisions_only=append_revisions_only)
+                    append_revisions_only=append_revisions_only,
+                    repository=repository)
         if response[0] != 'ok':
             raise errors.UnexpectedSmartServerResponse(response)
         # Turn the response into a RemoteRepository object.



More information about the bazaar-commits mailing list