Mercurial > hg
changeset 51079:15a50bfaeb79
censor: accept censored revision during upgrade
They can simply be passed by as censored.
author | Pierre-Yves David <pierre-yves.david@octobus.net> |
---|---|
date | Fri, 13 Oct 2023 23:21:46 +0200 |
parents | 45dab30f9d55 |
children | 09d60aed5f5d |
files | mercurial/revlog.py tests/test-censor.t |
diffstat | 2 files changed, 5 insertions(+), 9 deletions(-) [+] |
line wrap: on
line diff
--- a/mercurial/revlog.py Fri Oct 13 22:40:10 2023 +0200 +++ b/mercurial/revlog.py Fri Oct 13 23:21:46 2023 +0200 @@ -3537,7 +3537,11 @@ sidedata = None if not cachedelta: - rawtext = self._revisiondata(rev) + try: + rawtext = self._revisiondata(rev) + except error.CensoredNodeError as censored: + assert flags & REVIDX_ISCENSORED + rawtext = censored.tombstone sidedata = self.sidedata(rev) if sidedata is None: sidedata = self.sidedata(rev)
--- a/tests/test-censor.t Fri Oct 13 22:40:10 2023 +0200 +++ b/tests/test-censor.t Fri Oct 13 23:21:46 2023 +0200 @@ -561,10 +561,6 @@ - changelog - manifest - transaction abort! - rollback completed - abort: file censored target:613bc869fceb - [255] $ hg verify --config censor.policy=ignore checking changesets checking manifests @@ -598,10 +594,6 @@ - changelog - manifest - transaction abort! - rollback completed - abort: file censored target:613bc869fceb - [255] $ hg verify --config censor.policy=ignore checking changesets checking manifests