Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/error.py @ 32622:19df975eb555
obsolete: raise richer exception on unknown version
We raise a more precise subclass of Abort with details about the faulty
version. This will be used to detect this case and display some information
in debugbundle.
author | Pierre-Yves David <pierre-yves.david@octobus.net> |
---|---|
date | Thu, 25 May 2017 16:50:23 +0200 |
parents | c8e10565a113 |
children | 6df193b5c437 |
comparison
equal
deleted
inserted
replaced
32621:9e46627baa3c | 32622:19df975eb555 |
---|---|
135 s = ' '.join(self.recordtypes) | 135 s = ' '.join(self.recordtypes) |
136 Abort.__init__( | 136 Abort.__init__( |
137 self, _('unsupported merge state records: %s') % s, | 137 self, _('unsupported merge state records: %s') % s, |
138 hint=_('see https://mercurial-scm.org/wiki/MergeStateRecords for ' | 138 hint=_('see https://mercurial-scm.org/wiki/MergeStateRecords for ' |
139 'more information')) | 139 'more information')) |
140 | |
141 class UnknownVersion(Abort): | |
142 """generic exception for aborting from an encounter with an unknown version | |
143 """ | |
144 | |
145 def __init__(self, msg, hint=None, version=None): | |
146 self.version = version | |
147 super(UnknownVersion, self).__init__(msg, hint=hint) | |
140 | 148 |
141 class LockError(IOError): | 149 class LockError(IOError): |
142 def __init__(self, errno, strerror, filename, desc): | 150 def __init__(self, errno, strerror, filename, desc): |
143 IOError.__init__(self, errno, strerror, filename) | 151 IOError.__init__(self, errno, strerror, filename) |
144 self.desc = desc | 152 self.desc = desc |