~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/bundle/__init__.py

  • Committer: Patch Queue Manager
  • Date: 2016-04-21 04:10:52 UTC
  • mfrom: (6616.1.1 fix-en-user-guide)
  • Revision ID: pqm@pqm.ubuntu.com-20160421041052-clcye7ns1qcl2n7w
(richard-wilbur) Ensure build of English use guide always uses English text
 even when user's locale specifies a different language. (Jelmer Vernooij)

Show diffs side-by-side

added added

removed removed

Lines of Context:
14
14
# along with this program; if not, write to the Free Software
15
15
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
16
16
 
 
17
from __future__ import absolute_import
 
18
 
17
19
from cStringIO import StringIO
18
20
 
19
21
from bzrlib.lazy_import import lazy_import
20
22
lazy_import(globals(), """
21
23
from bzrlib import (
22
24
    errors,
 
25
    transport as _mod_transport,
23
26
    urlutils,
24
27
    )
25
28
from bzrlib.bundle import serializer as _serializer
26
29
from bzrlib.merge_directive import MergeDirective
27
 
from bzrlib.transport import (
28
 
    do_catching_redirections,
29
 
    get_transport,
30
 
    )
 
30
from bzrlib.i18n import gettext
31
31
""")
32
32
from bzrlib.trace import note
33
33
 
38
38
    :return: An object supporting get_target_revision.  Raises NotABundle if
39
39
        the target is not a mergeable type.
40
40
    """
41
 
    child_transport = get_transport(url,
 
41
    child_transport = _mod_transport.get_transport(url,
42
42
        possible_transports=possible_transports)
43
43
    transport = child_transport.clone('..')
44
44
    filename = transport.relpath(child_transport.base)
56
56
        url, filename = urlutils.split(exception.target,
57
57
                                       exclude_trailing_slash=False)
58
58
        if not filename:
59
 
            raise errors.NotABundle('A directory cannot be a bundle')
60
 
        return get_transport(url)
 
59
            raise errors.NotABundle(gettext('A directory cannot be a bundle'))
 
60
        return _mod_transport.get_transport_from_url(url)
61
61
 
62
62
    try:
63
 
        bytef, transport = do_catching_redirections(get_bundle, transport,
64
 
                                                    redirected_transport)
 
63
        bytef, transport = _mod_transport.do_catching_redirections(
 
64
            get_bundle, transport, redirected_transport)
65
65
    except errors.TooManyRedirections:
66
66
        raise errors.NotABundle(transport.clone(filename).base)
67
67
    except (errors.ConnectionReset, errors.ConnectionError), e: