##// END OF EJS Templates
obsolete: raise richer exception on unknown version...
marmoute -
r32591:19df975e default
parent child Browse files
Show More
@@ -138,6 +138,14 class UnsupportedMergeRecords(Abort):
138 138 hint=_('see https://mercurial-scm.org/wiki/MergeStateRecords for '
139 139 'more information'))
140 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)
148
141 149 class LockError(IOError):
142 150 def __init__(self, errno, strerror, filename, desc):
143 151 IOError.__init__(self, errno, strerror, filename)
@@ -446,8 +446,8 def _readmarkers(data):
446 446 diskversion = _unpack('>B', data[off:off + 1])[0]
447 447 off += 1
448 448 if diskversion not in formats:
449 raise error.Abort(_('parsing obsolete marker: unknown version %r')
450 % diskversion)
449 msg = _('parsing obsolete marker: unknown version %r') % diskversion
450 raise error.UnknownVersion(msg, version=diskversion)
451 451 return diskversion, formats[diskversion][0](data, off)
452 452
453 453 def encodemarkers(markers, addheader=False, version=_fm0version):
General Comments 0
You need to be logged in to leave comments. Login now