comparison mercurial/error.py @ 39777:b63dee7bd0d9

global: replace most uses of RevlogError with StorageError (API) When catching errors in storage, we should be catching StorageError instead of RevlogError. When throwing errors related to storage, we shouldn't be using RevlogError unless we know the error stemmed from revlogs. And we only reliably know that if we're in revlog.py or are inheriting from a type defined in revlog.py. Differential Revision: https://phab.mercurial-scm.org/D4655
author Gregory Szorc <gregory.szorc@gmail.com>
date Tue, 18 Sep 2018 16:47:09 -0700
parents cb65d4b7e429
children f732889abe0e
comparison
equal deleted inserted replaced
39776:cb65d4b7e429 39777:b63dee7bd0d9
281 self.ret = ret 281 self.ret = ret
282 # no i18n expected to be processed into a better message 282 # no i18n expected to be processed into a better message
283 Abort.__init__(self, 'failed to update value for "%s/%s"' 283 Abort.__init__(self, 'failed to update value for "%s/%s"'
284 % (namespace, key)) 284 % (namespace, key))
285 285
286 class CensoredNodeError(RevlogError): 286 class CensoredNodeError(StorageError):
287 """error raised when content verification fails on a censored node 287 """error raised when content verification fails on a censored node
288 288
289 Also contains the tombstone data substituted for the uncensored data. 289 Also contains the tombstone data substituted for the uncensored data.
290 """ 290 """
291 291
292 def __init__(self, filename, node, tombstone): 292 def __init__(self, filename, node, tombstone):
293 from .node import short 293 from .node import short
294 RevlogError.__init__(self, '%s:%s' % (filename, short(node))) 294 StorageError.__init__(self, '%s:%s' % (filename, short(node)))
295 self.tombstone = tombstone 295 self.tombstone = tombstone
296 296
297 class CensoredBaseError(RevlogError): 297 class CensoredBaseError(StorageError):
298 """error raised when a delta is rejected because its base is censored 298 """error raised when a delta is rejected because its base is censored
299 299
300 A delta based on a censored revision must be formed as single patch 300 A delta based on a censored revision must be formed as single patch
301 operation which replaces the entire base with new content. This ensures 301 operation which replaces the entire base with new content. This ensures
302 the delta may be applied by clones which have not censored the base. 302 the delta may be applied by clones which have not censored the base.