/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: 2019-03-04 00:16:27 UTC
  • mfrom: (7293 work)
  • mto: This revision was merged to the branch mainline in revision 7318.
  • Revision ID: jelmer@jelmer.uk-20190304001627-v6u7o6pf97tukhek
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 %(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.")
53
54
 
54
55
    def __init__(self, source, target, mapping, revision_id=None):
55
56
        self.source = source
58
59
        self.revision_id = revision_id
59
60
 
60
61
 
61
 
class GitSmartRemoteNotSupported(bzr_errors.UnsupportedOperation):
 
62
class GitSmartRemoteNotSupported(brz_errors.UnsupportedOperation):
62
63
    _fmt = "This operation is not supported by the Git smart server protocol."
63
64
 
64
65
 
65
 
class UnknownCommitExtra(bzr_errors.BzrError):
 
66
class UnknownCommitExtra(brz_errors.BzrError):
66
67
    _fmt = "Unknown extra fields in %(object)r: %(fields)r."
67
68
 
68
69
    def __init__(self, object, fields):
69
 
        bzr_errors.BzrError.__init__(self)
 
70
        brz_errors.BzrError.__init__(self)
70
71
        self.object = object
71
72
        self.fields = ",".join(fields)
72
73
 
73
74
 
74
 
class UnknownMercurialCommitExtra(bzr_errors.BzrError):
 
75
class UnknownMercurialCommitExtra(brz_errors.BzrError):
75
76
    _fmt = "Unknown mercurial extra fields in %(object)r: %(fields)r."
76
77
 
77
78
    def __init__(self, object, fields):
78
 
        bzr_errors.BzrError.__init__(self)
 
79
        brz_errors.BzrError.__init__(self)
79
80
        self.object = object
80
 
        self.fields = ",".join(fields)
 
81
        self.fields = b",".join(fields)