Patchwork D10790: censor: drop size limitation on the tombstone

login
register
mail settings
Submitter phabricator
Date May 28, 2021, 10:58 p.m.
Message ID <differential-rev-PHID-DREV-wsk2smi2qazylxu6eztl-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/49107/
State Superseded
Headers show

Comments

phabricator - May 28, 2021, 10:58 p.m.
marmoute created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  This limitation seems to date back from a previous implementation of censors,
  were the revision were censored" in place. For a long while the implementation
  actually involved rewriting the revlog before replacing the original data. So it looks like we can safely remove this limitation.
  
  The tests suite agrees.

REPOSITORY
  rHG Mercurial

BRANCH
  default

REVISION DETAIL
  https://phab.mercurial-scm.org/D10790

AFFECTED FILES
  mercurial/revlogutils/censor.py
  tests/test-censor.t

CHANGE DETAILS




To: marmoute, #hg-reviewers
Cc: mercurial-patches, mercurial-devel

Patch

diff --git a/tests/test-censor.t b/tests/test-censor.t
--- a/tests/test-censor.t
+++ b/tests/test-censor.t
@@ -66,12 +66,6 @@ 
   $ hg cat -r 0 target | head -n 10
   Initially untainted file
 
-Try to censor revision with too large of a tombstone message
-
-  $ hg censor -r $C1 -t 'blah blah blah blah blah blah blah blah bla' target
-  abort: censor tombstone must be no longer than censored data
-  [255]
-
 Censor revision with 2 offenses
 
 (this also tests file pattern matching: path relative to cwd case)
diff --git a/mercurial/revlogutils/censor.py b/mercurial/revlogutils/censor.py
--- a/mercurial/revlogutils/censor.py
+++ b/mercurial/revlogutils/censor.py
@@ -29,11 +29,6 @@ 
     censorrev = rl.rev(censornode)
     tombstone = storageutil.packmeta({b'censored': tombstone}, b'')
 
-    if len(tombstone) > rl.rawsize(censorrev):
-        raise error.Abort(
-            _(b'censor tombstone must be no longer than censored data')
-        )
-
     # Rewriting the revlog in place is hard. Our strategy for censoring is
     # to create a new revlog, copy all revisions to it, then replace the
     # revlogs on transaction close.