Mercurial > hg
comparison hgext/sqlitestore.py @ 51270: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 | 4c6151b69085 |
children |
comparison
equal
deleted
inserted
replaced
51269:db121ddd171e | 51270:ceeb8fa23cc8 |
---|---|
808 addrevisioncb(self, rev) | 808 addrevisioncb(self, rev) |
809 empty = False | 809 empty = False |
810 | 810 |
811 return not empty | 811 return not empty |
812 | 812 |
813 def censorrevision(self, tr, censornode, tombstone=b''): | 813 def censorrevision(self, tr, censor_nodes, tombstone=b''): |
814 for node in censor_nodes: | |
815 self._censor_one_revision(tr, node, tombstone=tombstone) | |
816 | |
817 def _censor_one_revision(self, tr, censornode, tombstone): | |
814 tombstone = storageutil.packmeta({b'censored': tombstone}, b'') | 818 tombstone = storageutil.packmeta({b'censored': tombstone}, b'') |
815 | 819 |
816 # This restriction is cargo culted from revlogs and makes no sense for | 820 # This restriction is cargo culted from revlogs and makes no sense for |
817 # SQLite, since columns can be resized at will. | 821 # SQLite, since columns can be resized at will. |
818 if len(tombstone) > len(self.rawdata(censornode)): | 822 if len(tombstone) > len(self.rawdata(censornode)): |