comparison mercurial/error.py @ 24190:903c7e8c97ad

changegroup: emit full-replacement deltas if either revision is censored To ensure that exchanged deltas in the presence of censored revisions can always be applied to the recipient repository, the deltas must replace the entire base text. To make this restriction reasonably enforceable, the delta must do so with a single patch operation. For background and broader design of the censorship feature, see: http://mercurial.selenic.com/wiki/CensorPlan
author Mike Edgar <adgar@google.com>
date Wed, 21 Jan 2015 22:09:32 -0500
parents dcfdfd63bde4
children d2b81256db1e
comparison
equal deleted inserted replaced
24189:8b4b9ee6001a 24190:903c7e8c97ad
136 class ReadOnlyPartError(RuntimeError): 136 class ReadOnlyPartError(RuntimeError):
137 """error raised when code tries to alter a part being generated""" 137 """error raised when code tries to alter a part being generated"""
138 pass 138 pass
139 139
140 class CensoredNodeError(RevlogError): 140 class CensoredNodeError(RevlogError):
141 """error raised when content verification fails on a censored node""" 141 """error raised when content verification fails on a censored node
142 142
143 def __init__(self, filename, node): 143 Also contains the tombstone data substituted for the uncensored data.
144 """
145
146 def __init__(self, filename, node, tombstone):
144 from node import short 147 from node import short
145 RevlogError.__init__(self, '%s:%s' % (filename, short(node))) 148 RevlogError.__init__(self, '%s:%s' % (filename, short(node)))
149 self.tombstone = tombstone
146 150
147 class CensoredBaseError(RevlogError): 151 class CensoredBaseError(RevlogError):
148 """error raised when a delta is rejected because its base is censored 152 """error raised when a delta is rejected because its base is censored
149 153
150 A delta based on a censored revision must be formed as single patch 154 A delta based on a censored revision must be formed as single patch