~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/bundle/__init__.py

merge 2.0 branch rev 4647

Show diffs side-by-side

added added

removed removed

Lines of Context:
45
45
        possible_transports=possible_transports)
46
46
    transport = child_transport.clone('..')
47
47
    filename = transport.relpath(child_transport.base)
48
 
    if filename.endswith('/'):
49
 
        # A path to a directory was passed in
50
 
        # definitely not a bundle
51
 
        raise errors.NotABundle('A directory cannot be a bundle')
52
48
    mergeable, transport = read_mergeable_from_transport(transport, filename,
53
49
                                                         _do_directive)
54
50
    return mergeable
74
70
            f, transport = do_catching_redirections(get_bundle, transport,
75
71
                                                    redirected_transport)
76
72
        except errors.TooManyRedirections:
77
 
            raise errors.NotABundle(str(url))
 
73
            raise errors.NotABundle(transport.clone(filename).base)
78
74
 
79
75
        if _do_directive:
80
76
            from bzrlib.merge_directive import MergeDirective
82
78
            return directive, transport
83
79
        else:
84
80
            return _serializer.read_bundle(f), transport
85
 
    except errors.ConnectionReset:
 
81
    except (errors.ConnectionReset, errors.ConnectionError), e:
86
82
        raise
87
83
    except (errors.TransportError, errors.PathError), e:
88
84
        raise errors.NotABundle(str(e))