~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/bundle/__init__.py

  • Committer: John Arbash Meinel
  • Date: 2009-02-05 20:55:35 UTC
  • mto: (4464.4.1 jam-integration)
  • mto: This revision was merged to the branch mainline in revision 4487.
  • Revision ID: john@arbash-meinel.com-20090205205535-pem827po5a2h204o
Don't trap a regular ConnectionError when trying to read a mergeable from a url.

Show diffs side-by-side

added added

removed removed

Lines of Context:
39
39
    :return: An object supporting get_target_revision.  Raises NotABundle if
40
40
        the target is not a mergeable type.
41
41
    """
 
42
    if url.endswith('/'):
 
43
        # A path to a directory was passed in
 
44
        # definitely not a bundle
 
45
        raise errors.NotABundle('A directory cannot be a bundle')
42
46
    child_transport = get_transport(url,
43
47
        possible_transports=possible_transports)
44
48
    transport = child_transport.clone('..')
45
49
    filename = transport.relpath(child_transport.base)
46
 
    if filename.endswith('/'):
47
 
        # A path to a directory was passed in
48
 
        # definitely not a bundle
49
 
        raise errors.NotABundle('A directory cannot be a bundle')
50
50
    mergeable, transport = read_mergeable_from_transport(transport, filename,
51
51
                                                         _do_directive)
52
52
    return mergeable
80
80
            return directive, transport
81
81
        else:
82
82
            return _serializer.read_bundle(f), transport
83
 
    except errors.ConnectionReset:
 
83
    except (errors.ConnectionReset, errors.ConnectionError), e:
84
84
        raise
85
85
    except (errors.TransportError, errors.PathError), e:
86
86
        raise errors.NotABundle(str(e))