/breezy/trunk

To get this branch, use:
bzr branch https://code.breezy-vcs.org/breezy/trunk

« back to all changes in this revision

Viewing changes to breezy/git/errors.py

Merge trunk.

Show diffs side-by-side

added added

removed removed

Lines of Context:
22
22
 
23
23
from dulwich import errors as git_errors
24
24
 
25
 
from .. import errors as bzr_errors
26
 
 
27
 
 
28
 
class BzrGitError(bzr_errors.BzrError):
 
25
from .. import errors as brz_errors
 
26
 
 
27
 
 
28
class BzrGitError(brz_errors.BzrError):
29
29
    """The base-level exception for bzr-git errors."""
30
30
 
31
31
 
44
44
    """Convert a Dulwich error to a Bazaar error."""
45
45
 
46
46
    if isinstance(error, git_errors.HangupException):
47
 
        raise bzr_errors.ConnectionReset(error.msg, "")
 
47
        raise brz_errors.ConnectionReset(error.msg, "")
48
48
    raise error
49
49
 
50
50
 
51
 
class NoPushSupport(bzr_errors.BzrError):
52
 
    _fmt = ("Push is not yet supported from %(source)r to %(target)r using "
53
 
            "%(mapping)r for %(revision_id)r. Try dpush instead.")
 
51
class NoPushSupport(brz_errors.BzrError):
 
52
    _fmt = ("Push is not yet supported from %(source)r to %(target)r "
 
53
            "using %(mapping)r for %(revision_id)r. Try dpush instead.")
54
54
 
55
55
    def __init__(self, source, target, mapping, revision_id=None):
56
56
        self.source = source
59
59
        self.revision_id = revision_id
60
60
 
61
61
 
62
 
class GitSmartRemoteNotSupported(bzr_errors.UnsupportedOperation):
 
62
class GitSmartRemoteNotSupported(brz_errors.UnsupportedOperation):
63
63
    _fmt = "This operation is not supported by the Git smart server protocol."
64
64
 
65
65
 
66
 
class UnknownCommitExtra(bzr_errors.BzrError):
 
66
class UnknownCommitExtra(brz_errors.BzrError):
67
67
    _fmt = "Unknown extra fields in %(object)r: %(fields)r."
68
68
 
69
69
    def __init__(self, object, fields):
70
 
        bzr_errors.BzrError.__init__(self)
 
70
        brz_errors.BzrError.__init__(self)
71
71
        self.object = object
72
72
        self.fields = ",".join(fields)
73
73
 
74
74
 
75
 
class UnknownMercurialCommitExtra(bzr_errors.BzrError):
 
75
class UnknownMercurialCommitExtra(brz_errors.BzrError):
76
76
    _fmt = "Unknown mercurial extra fields in %(object)r: %(fields)r."
77
77
 
78
78
    def __init__(self, object, fields):
79
 
        bzr_errors.BzrError.__init__(self)
 
79
        brz_errors.BzrError.__init__(self)
80
80
        self.object = object
81
81
        self.fields = ",".join(fields)