Skip to content
Snippets Groups Projects
Commit aab06441 authored by Pierre-Yves David's avatar Pierre-Yves David :octopus:
Browse files

censor: rename `rl` to `revlog` in the main function

Now that the bulk of the code moved to smaller function we are less restricted
on line length and we can use more explicite naming.

Differential Revision: https://phab.mercurial-scm.org/D10902
parent d6afe147
No related branches found
No related tags found
No related merge requests found
......@@ -125,7 +125,7 @@
rl._loadindex()
def v2_censor(rl, tr, censornode, tombstone=b''):
def v2_censor(revlog, tr, censornode, tombstone=b''):
"""censors a revision in a "version 2" revlog"""
# General principle
#
......@@ -140,6 +140,6 @@
# All data before the censored data can be blindly copied. The rest needs
# to be copied as we go and the associated index entry needs adjustement.
assert rl._format_version != REVLOGV0, rl._format_version
assert rl._format_version != REVLOGV1, rl._format_version
assert revlog._format_version != REVLOGV0, revlog._format_version
assert revlog._format_version != REVLOGV1, revlog._format_version
......@@ -145,4 +145,4 @@
old_index = rl.index
docket = rl._docket
old_index = revlog.index
docket = revlog._docket
......@@ -148,4 +148,4 @@
censor_rev = rl.rev(censornode)
censor_rev = revlog.rev(censornode)
tombstone = storageutil.packmeta({b'censored': tombstone}, b'')
......@@ -150,5 +150,5 @@
tombstone = storageutil.packmeta({b'censored': tombstone}, b'')
censored_entry = rl.index[censor_rev]
index_cutoff = rl.index.entry_size * censor_rev
censored_entry = revlog.index[censor_rev]
index_cutoff = revlog.index.entry_size * censor_rev
data_cutoff = censored_entry[ENTRY_DATA_OFFSET] >> 16
......@@ -154,6 +154,6 @@
data_cutoff = censored_entry[ENTRY_DATA_OFFSET] >> 16
sidedata_cutoff = rl.sidedata_cut_off(censor_rev)
sidedata_cutoff = revlog.sidedata_cut_off(censor_rev)
with pycompat.unnamedtempfile(mode=b"w+b") as tmp_storage:
# rev → (new_base, data_start, data_end, compression_mode)
rewritten_entries = _precompute_rewritten_delta(
......@@ -156,11 +156,11 @@
with pycompat.unnamedtempfile(mode=b"w+b") as tmp_storage:
# rev → (new_base, data_start, data_end, compression_mode)
rewritten_entries = _precompute_rewritten_delta(
rl,
revlog,
old_index,
{censor_rev},
tmp_storage,
)
all_files = _setup_new_files(
......@@ -161,10 +161,10 @@
old_index,
{censor_rev},
tmp_storage,
)
all_files = _setup_new_files(
rl,
revlog,
index_cutoff,
data_cutoff,
sidedata_cutoff,
......@@ -183,7 +183,7 @@
# writing the censored revision
_rewrite_censor(
rl,
revlog,
old_index,
open_files,
censor_rev,
......@@ -193,7 +193,7 @@
# Writing all subsequent revisions
for rev in range(censor_rev + 1, len(old_index)):
_rewrite_simple(
rl,
revlog,
old_index,
open_files,
rev,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment