~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/branch.py

  • Committer: Robert Collins
  • Date: 2005-10-17 23:13:00 UTC
  • mto: This revision was merged to the branch mainline in revision 1462.
  • Revision ID: robertc@robertcollins.net-20051017231300-e1c9e931bcfacd6a
Branch.open_containing now returns a tuple (Branch, relative-path).

This allows direct access to the common case of 'get me this file
from its branch'. (Robert Collins)

Show diffs side-by-side

added added

removed removed

Lines of Context:
125
125
 
126
126
        Basically we keep looking up until we find the control directory or
127
127
        run into the root.  If there isn't one, raises NotBranchError.
 
128
        If there is one, it is returned, along with the unused portion of url.
128
129
        """
129
130
        t = get_transport(url)
130
131
        while True:
131
132
            try:
132
 
                return _Branch(t)
 
133
                return _Branch(t), t.relpath(url)
133
134
            except NotBranchError:
134
135
                pass
135
136
            new_t = t.clone('..')