Rev 2957: Fix first unwanted connection. in file:///v/home/vila/src/bzr/bugs/159150/
Vincent Ladeuil
v.ladeuil+lp at free.fr
Thu Nov 1 12:14:49 GMT 2007
At file:///v/home/vila/src/bzr/bugs/159150/
------------------------------------------------------------
revno: 2957
revision-id:v.ladeuil+lp at free.fr-20071101121447-o8uwn30mroh7ju9i
parent: v.ladeuil+lp at free.fr-20071031224603-omyf4if730mfwm1h
committer: Vincent Ladeuil <v.ladeuil+lp at free.fr>
branch nick: 159150
timestamp: Thu 2007-11-01 13:14:47 +0100
message:
Fix first unwanted connection.
* bzrlib/branch.py:
(BranchReferenceFormat.initialize): Give self.open the transport
to be reused via possible_transports.
(BranchReferenceFormat.open): Add a possible_transports parameter.
modified:
bzrlib/branch.py branch.py-20050309040759-e4baf4e0d046576e
-------------- next part --------------
=== modified file 'bzrlib/branch.py'
--- a/bzrlib/branch.py 2007-10-11 04:54:04 +0000
+++ b/bzrlib/branch.py 2007-11-01 12:14:47 +0000
@@ -1191,7 +1191,7 @@
def get_format_description(self):
"""See BranchFormat.get_format_description()."""
return "Checkout reference format 1"
-
+
def get_reference(self, a_bzrdir):
"""See BranchFormat.get_reference()."""
transport = a_bzrdir.get_branch_transport(None)
@@ -1208,7 +1208,9 @@
branch_transport.put_bytes('location',
target_branch.bzrdir.root_transport.base)
branch_transport.put_bytes('format', self.get_format_string())
- return self.open(a_bzrdir, _found=True)
+ return self.open(
+ a_bzrdir, _found=True,
+ possible_transports=[target_branch.bzrdir.root_transport])
def __init__(self):
super(BranchReferenceFormat, self).__init__()
@@ -1224,7 +1226,8 @@
# emit some sort of warning/error to the caller ?!
return clone
- def open(self, a_bzrdir, _found=False, location=None):
+ def open(self, a_bzrdir, _found=False, location=None,
+ possible_transports=None):
"""Return the branch that the branch reference in a_bzrdir points at.
_found is a private parameter, do not use it. It is used to indicate
@@ -1235,7 +1238,8 @@
assert format.__class__ == self.__class__
if location is None:
location = self.get_reference(a_bzrdir)
- real_bzrdir = bzrdir.BzrDir.open(location)
+ real_bzrdir = bzrdir.BzrDir.open(
+ location, possible_transports=possible_transports)
result = real_bzrdir.open_branch()
# this changes the behaviour of result.clone to create a new reference
# rather than a copy of the content of the branch.
More information about the bazaar-commits
mailing list