~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/bundle/__init__.py

  • Committer: Andrew Bennetts
  • Date: 2010-07-29 11:17:57 UTC
  • mfrom: (5050.3.17 2.2)
  • mto: This revision was merged to the branch mainline in revision 5365.
  • Revision ID: andrew.bennetts@canonical.com-20100729111757-018h3pcefo7z0dnq
Merge lp:bzr/2.2 into lp:bzr.

Show diffs side-by-side

added added

removed removed

Lines of Context:
20
20
lazy_import(globals(), """
21
21
from bzrlib import (
22
22
    errors,
23
 
    transport as _mod_transport,
24
23
    urlutils,
25
24
    )
26
25
from bzrlib.bundle import serializer as _serializer
27
26
from bzrlib.merge_directive import MergeDirective
28
 
from bzrlib.i18n import gettext
 
27
from bzrlib.transport import (
 
28
    do_catching_redirections,
 
29
    get_transport,
 
30
    )
29
31
""")
30
32
from bzrlib.trace import note
31
33
 
36
38
    :return: An object supporting get_target_revision.  Raises NotABundle if
37
39
        the target is not a mergeable type.
38
40
    """
39
 
    child_transport = _mod_transport.get_transport(url,
 
41
    child_transport = get_transport(url,
40
42
        possible_transports=possible_transports)
41
43
    transport = child_transport.clone('..')
42
44
    filename = transport.relpath(child_transport.base)
54
56
        url, filename = urlutils.split(exception.target,
55
57
                                       exclude_trailing_slash=False)
56
58
        if not filename:
57
 
            raise errors.NotABundle(gettext('A directory cannot be a bundle'))
58
 
        return _mod_transport.get_transport_from_url(url)
 
59
            raise errors.NotABundle('A directory cannot be a bundle')
 
60
        return get_transport(url)
59
61
 
60
62
    try:
61
 
        bytef, transport = _mod_transport.do_catching_redirections(
62
 
            get_bundle, transport, redirected_transport)
 
63
        bytef, transport = do_catching_redirections(get_bundle, transport,
 
64
                                                    redirected_transport)
63
65
    except errors.TooManyRedirections:
64
66
        raise errors.NotABundle(transport.clone(filename).base)
65
67
    except (errors.ConnectionReset, errors.ConnectionError), e: