~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/bundle/__init__.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2008-03-25 08:34:30 UTC
  • mfrom: (3251.4.12 pull-lp)
  • Revision ID: pqm@pqm.ubuntu.com-20080325083430-0w0gjtnkegce7718
Allow pulling from lp: urls (abentley, #181945)

Show diffs side-by-side

added added

removed removed

Lines of Context:
35
35
    return read_mergeable_from_url(url, _do_directive=False)
36
36
 
37
37
 
38
 
def read_mergeable_from_url(url, _do_directive=True):
 
38
def read_mergeable_from_url(url, _do_directive=True, possible_transports=None):
39
39
    """Read mergable object from a given URL.
40
40
 
41
41
    :return: An object supporting get_target_revision.  Raises NotABundle if
42
42
        the target is not a mergeable type.
43
43
    """
44
 
    url = urlutils.normalize_url(url)
45
 
    url, filename = urlutils.split(url, exclude_trailing_slash=False)
46
 
    if not filename:
 
44
    child_transport = get_transport(url,
 
45
        possible_transports=possible_transports)
 
46
    transport = child_transport.clone('..')
 
47
    filename = transport.relpath(child_transport.base)
 
48
    if filename.endswith('/'):
47
49
        # A path to a directory was passed in
48
50
        # definitely not a bundle
49
51
        raise errors.NotABundle('A directory cannot be a bundle')
50
 
 
51
 
    transport = get_transport(url)
52
52
    mergeable, transport = read_mergeable_from_transport(transport, filename,
53
53
                                                         _do_directive)
54
54
    return mergeable