This is an archive of the discontinued Mercurial Phabricator instance.

censor: implement censoring for revlogv2
ClosedPublic

Authored by marmoute on Jun 11 2021, 6:56 AM.

Details

Summary

It is a bit verbose and rough, but it works. Most of that logic can be common
for stripping, so we can expect more refactoring of that code to accommodate
both needs. However I wanted to keep this changesets "simple enough" and before
moving forward.

We also need to properly delete the older index/data/sidedata file, but this has
implication for streaming clone and transaction, so this will come later.

Diff Detail

Repository
rHG Mercurial
Branch
default
Lint
No Linters Available
Unit
No Unit Test Coverage

Event Timeline

marmoute created this revision.Jun 11 2021, 6:56 AM
baymax updated this revision to Diff 28569.Jun 15 2021, 7:39 AM

✅ refresh by Heptapod after a successful CI run (🐙 💚)

Alphare requested changes to this revision.Jun 16 2021, 12:25 PM
Alphare added a subscriber: Alphare.
Alphare added inline comments.
mercurial/revlogutils/censor.py
153

We should replace cut_off to cutoff in all of those signatures, since it's the noun and not the verb, to avoid confusion

224

Should be all_files

301

data_delta_base, start, end, rewritten_entries[rev] should be data_delta_base, start, end = rewritten_entries[rev]. This makes me think that the censor tests do not look at the case where a revs have a censored node as delta base, which wouldn't be surprising since the last version didn't handle this. But we should add a test case for this.

This revision now requires changes to proceed.Jun 16 2021, 12:25 PM
baymax updated this revision to Diff 28629.Jun 21 2021, 1:14 AM

✅ refresh by Heptapod after a successful CI run (🐙 💚)

Alphare added inline comments.Jun 21 2021, 5:26 AM
mercurial/revlogutils/censor.py
189

I'm not really sure I understand what we're doing here with the compression settings. (also, the comment about tell() is not at the right place anymore)

marmoute updated this revision to Diff 28647.Jun 21 2021, 9:10 AM
Alphare accepted this revision.Jun 21 2021, 10:24 AM
This revision is now accepted and ready to land.Jun 21 2021, 10:24 AM
This revision was automatically updated to reflect the committed changes.