[RFC/MERGE] Branch.get_master_branch() should default to using self as a possible transport

John Arbash Meinel john at arbash-meinel.com
Wed Jan 14 20:19:53 GMT 2009


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

This is a quick change to 'Branch.get_master_branch()'. All it does is
insert self.bzrdir.transport into the list of possible transports to re-use.

I'm offering this, because it seems like we have a transport that we may
want to re-use. I'm leaving this as RFC, because I'm not sure the exact
use case, as it means the branch would have to be remote, and bound to
another remote branch to actually be useful.

I can't quite decide if that is worth persuing, as it is probably an
edge case, but I figured I could bring it up for discussion.

John
=:->


=== modified file 'bzrlib/branch.py'
- --- bzrlib/branch.py    2009-01-08 19:15:20 +0000
+++ bzrlib/branch.py    2009-01-14 20:17:18 +0000
@@ -1982,12 +1982,13 @@
         So for now we just don't memoise it.
         # RBC 20060304 review this decision.
         """
+        allowed_transports = [self.bzrdir.transport] + possible_transports
         bound_loc = self.get_bound_location()
         if not bound_loc:
             return None
         try:
             return Branch.open(bound_loc,
- -                               possible_transports=possible_transports)
+                               possible_transports=allowed_transports)
         except (errors.NotBranchError, errors.ConnectionError), e:
             raise errors.BoundBranchConnectionFailure(
                     self, bound_loc, e)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkluSOkACgkQJdeBCYSNAANQggCgj3EvMPXSs/tWzfk7eTCKwKKu
gPQAn0V0Egodul/UucC/bU/cN2P0h6rS
=q4HS
-----END PGP SIGNATURE-----



More information about the bazaar mailing list