~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/bundle/__init__.py

  • Committer: Jelmer Vernooij
  • Date: 2011-12-16 16:40:10 UTC
  • mto: This revision was merged to the branch mainline in revision 6391.
  • Revision ID: jelmer@samba.org-20111216164010-z3hy00xrnclnkf7a
Update tests.

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