[MERGE] Branch.open_containing_from_transport() (was Re: [MERGE] Make pull more forgiving of its location)

Matthew D. Fuller fullermd at over-yonder.net
Mon Oct 29 19:57:40 GMT 2007


On Thu, Sep 13, 2007 at 03:11:52PM -0400 I heard the voice of
Aaron Bentley, and lo! it spake thus:
> Comment:
> It would have been nice to make Branch.open_containing_from_transport

Well, as long as the pull patch is on held, I took a glance at this.
Attacked trivial bundle adds the function.  No tests are included.
But then, there aren't any tests for Branch.open_from_transport()
either (and there barely is for Branch.open_containing() for that
matter), so I don't have any real guidance on where one would go.


-- 
Matthew Fuller     (MF4839)   |  fullermd at over-yonder.net
Systems/Network Administrator |  http://www.over-yonder.net/~fullermd/
           On the Internet, nobody can hear you scream.
-------------- next part --------------
# Bazaar merge directive format 2 (Bazaar 0.90)
# revision_id: fullermd at over-yonder.net-20071029192708-\
#   wll7uqauhl8r4wv2
# target_branch: file:///home/fullermd/src/bzr/bzr.dev/
# testament_sha1: cf78a52a764844b1f1573c4f97c2dc707e7fd74d
# timestamp: 2007-10-29 14:53:44 -0500
# base_revision_id: pqm at pqm.ubuntu.com-20071029050400-j2jmz8smj2yecfrr
# 
# Begin patch
=== modified file 'bzrlib/branch.py'
--- bzrlib/branch.py	2007-10-11 04:54:04 +0000
+++ bzrlib/branch.py	2007-10-29 19:27:08 +0000
@@ -150,6 +150,13 @@
                                                          possible_transports)
         return control.open_branch(), relpath
 
+    @staticmethod
+    def open_containing_from_transport(a_transport):
+        """Open an existing branch which contains a_transport.base."""
+        control, relpath = bzrdir.BzrDir.open_containing_from_transport(
+            a_transport)
+        return control.open_branch(), relpath
+
     def get_config(self):
         return BranchConfig(self)
 

# Begin bundle
IyBCYXphYXIgcmV2aXNpb24gYnVuZGxlIHY0CiMKQlpoOTFBWSZTWfLM5QIAAZVfgERQUWf//3cC
gAC////wUAPeuru1nd2qq7Xu5oSSIFHhJ6NU/T1In6GlNp6Ub1Gg09U02p6gSSgJ6aeomp5RtT1B
ppkGgAAAGIhE00zUxR6g00D1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