~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/bundle/__init__.py

  • Committer: John Arbash Meinel
  • Date: 2011-05-11 11:35:28 UTC
  • mto: This revision was merged to the branch mainline in revision 5851.
  • Revision ID: john@arbash-meinel.com-20110511113528-qepibuwxicjrbb2h
Break compatibility with python <2.6.

This includes auditing the code for places where we were doing
explicit 'sys.version' checks and removing them as appropriate.

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