~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/bundle/__init__.py

  • Committer: John Arbash Meinel
  • Author(s): Mark Hammond
  • Date: 2008-09-09 17:02:21 UTC
  • mto: This revision was merged to the branch mainline in revision 3697.
  • Revision ID: john@arbash-meinel.com-20080909170221-svim3jw2mrz0amp3
An updated transparent icon for bzr.

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