comparison mercurial/error.py @ 45151:e429e7c801b2

error: normalize "unresolved conflicts" error messages with a custom class Differential Revision: https://phab.mercurial-scm.org/D8713
author Daniel Ploch <dploch@google.com>
date Tue, 14 Jul 2020 13:35:54 -0700
parents 9f70512ae2cf
children bd5b2b29b82d
comparison
equal deleted inserted replaced
45150:dc5e5577af39 45151:e429e7c801b2
102 102
103 class InterventionRequired(Hint, Exception): 103 class InterventionRequired(Hint, Exception):
104 """Exception raised when a command requires human intervention.""" 104 """Exception raised when a command requires human intervention."""
105 105
106 __bytes__ = _tobytes 106 __bytes__ = _tobytes
107
108
109 class ConflictResolutionRequired(InterventionRequired):
110 """Exception raised when a continuable command required merge conflict resolution."""
111
112 def __init__(self, opname):
113 from .i18n import _
114
115 self.opname = opname
116 InterventionRequired.__init__(
117 self,
118 _(
119 b"unresolved conflicts (see 'hg resolve', then 'hg %s --continue')"
120 )
121 % opname,
122 )
107 123
108 124
109 class Abort(Hint, Exception): 125 class Abort(Hint, Exception):
110 """Raised if a command needs to print an error and exit.""" 126 """Raised if a command needs to print an error and exit."""
111 127