[bug] Branch.open_containing refuses to open URLs

Martin Pool mbp at sourcefrog.net
Wed Jan 11 05:02:01 GMT 2006


Branch.open_containing has this code, apparently from Robert:

    @staticmethod
    def open_containing(path=None):
        """Open an existing working tree which has its root about path.
        
        This probes for a working tree at path and searches upwards from
there.

        Basically we keep looking up until we find the control directory
or
        run into /.  If there isn't one, raises NotBranchError.
        TODO: give this a new exception.
        If there is one, it is returned, along with the unused portion
of path.
        """
        if path is None:
            path = getcwd()
        else:
            # sanity check.
            if path.find('://') != -1:
                raise NotBranchError(path=path)

The exception means that you cannot, for example, run diff against a
remote repository.

  bzr diff -r 1528..1529 http://repo.spacepants.org/bzr.jaq/

Can we instead have something like this:

  if it's a path, make it absolute
  while true:
    try to open the url as the root of a directory
    otherwise, go up one step, unless already at the root directory 
       or top-level url

-- 
Martin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20060111/4eccb980/attachment.pgp 


More information about the bazaar mailing list