[Updated] D10869: censor: implement censoring for revlogv2

Alphare (Raphaël Gomès) phabricator at mercurial-scm.org
Wed Jun 16 16:25:13 UTC 2021


This revision now requires changes to proceed.
Alphare added inline comments.
Alphare requested changes to this revision.

INLINE COMMENTS

> censor.py:153
> +    censored_entry = rl.index[censor_rev]
> +    index_cut_off = rl.index.entry_size * censor_rev
> +    data_cut_off = censored_entry[ENTRY_DATA_OFFSET] >> 16

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

> censor.py:224
> +        @contextlib.contextmanager
> +        def all_file():
> +            # hide opening in an helper function to please check-code, black

Should be `all_files`

> censor.py:301
> +                else:
> +                    data_delta_base, start, end, rewritten_entries[rev]
> +                    new_data_size = end - start

`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.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D10869/new/

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

To: marmoute, indygreg, #hg-reviewers, Alphare
Cc: Alphare, mercurial-patches
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mercurial-scm.org/pipermail/mercurial-patches/attachments/20210616/5794ef05/attachment-0002.html>


More information about the Mercurial-patches mailing list