comparison mercurial/revlog.py @ 51267:ceeb8fa23cc8

censor: accept multiple revision in a single call This is useful when dealing with corruption, as all the corrupted revision can be dealt with in one go.
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Fri, 01 Dec 2023 22:56:08 +0100
parents f20c4b307a5a
children 5b3b6db49bbb
comparison
equal deleted inserted replaced
51266:db121ddd171e 51267:ceeb8fa23cc8
3833 ) 3833 )
3834 3834
3835 if addrevisioncb: 3835 if addrevisioncb:
3836 addrevisioncb(self, rev, node) 3836 addrevisioncb(self, rev, node)
3837 3837
3838 def censorrevision(self, tr, censornode, tombstone=b''): 3838 def censorrevision(self, tr, censor_nodes, tombstone=b''):
3839 if self._format_version == REVLOGV0: 3839 if self._format_version == REVLOGV0:
3840 raise error.RevlogError( 3840 raise error.RevlogError(
3841 _(b'cannot censor with version %d revlogs') 3841 _(b'cannot censor with version %d revlogs')
3842 % self._format_version 3842 % self._format_version
3843 ) 3843 )
3844 elif self._format_version == REVLOGV1: 3844 elif self._format_version == REVLOGV1:
3845 rewrite.v1_censor(self, tr, censornode, tombstone) 3845 rewrite.v1_censor(self, tr, censor_nodes, tombstone)
3846 else: 3846 else:
3847 rewrite.v2_censor(self, tr, censornode, tombstone) 3847 rewrite.v2_censor(self, tr, censor_nodes, tombstone)
3848 3848
3849 def verifyintegrity(self, state): 3849 def verifyintegrity(self, state):
3850 """Verifies the integrity of the revlog. 3850 """Verifies the integrity of the revlog.
3851 3851
3852 Yields ``revlogproblem`` instances describing problems that are 3852 Yields ``revlogproblem`` instances describing problems that are