/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to breezy/git/errors.py

  • Committer: Jelmer Vernooij
  • Date: 2018-11-16 10:50:21 UTC
  • mfrom: (7164 work)
  • mto: This revision was merged to the branch mainline in revision 7165.
  • Revision ID: jelmer@jelmer.uk-20181116105021-xl419v2rh4aus1au
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):
 
51
class NoPushSupport(brz_errors.BzrError):
52
52
    _fmt = "Push is not yet supported from %(source)r to %(target)r using %(mapping)r for %(revision_id)r. Try dpush instead."
53
53
 
54
54
    def __init__(self, source, target, mapping, revision_id=None):
58
58
        self.revision_id = revision_id
59
59
 
60
60
 
61
 
class GitSmartRemoteNotSupported(bzr_errors.UnsupportedOperation):
 
61
class GitSmartRemoteNotSupported(brz_errors.UnsupportedOperation):
62
62
    _fmt = "This operation is not supported by the Git smart server protocol."
63
63
 
64
64
 
65
 
class UnknownCommitExtra(bzr_errors.BzrError):
 
65
class UnknownCommitExtra(brz_errors.BzrError):
66
66
    _fmt = "Unknown extra fields in %(object)r: %(fields)r."
67
67
 
68
68
    def __init__(self, object, fields):
69
 
        bzr_errors.BzrError.__init__(self)
 
69
        brz_errors.BzrError.__init__(self)
70
70
        self.object = object
71
71
        self.fields = ",".join(fields)
72
72
 
73
73
 
74
 
class UnknownMercurialCommitExtra(bzr_errors.BzrError):
 
74
class UnknownMercurialCommitExtra(brz_errors.BzrError):
75
75
    _fmt = "Unknown mercurial extra fields in %(object)r: %(fields)r."
76
76
 
77
77
    def __init__(self, object, fields):
78
 
        bzr_errors.BzrError.__init__(self)
 
78
        brz_errors.BzrError.__init__(self)
79
79
        self.object = object
80
80
        self.fields = ",".join(fields)