~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/bundle/__init__.py

  • Committer: Jelmer Vernooij
  • Date: 2012-02-29 13:55:25 UTC
  • mto: (6437.23.22 2.5)
  • mto: This revision was merged to the branch mainline in revision 6493.
  • Revision ID: jelmer@samba.org-20120229135525-1krnrr2imulo56xj
Merge fix for bzrlib API link.

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: