( )⚙ D10630 revlog: move the `trypending` logic from the `changelog` to the `revlog`

This is an archive of the discontinued Mercurial Phabricator instance.

revlog: move the `trypending` logic from the `changelog` to the `revlog`
ClosedPublic

Authored by marmoute on May 3 2021, 7:55 AM.

Details

Summary

We move the -reading- logic for the pending's '.a' suffixed index within the
revlog class. This is motivated by the fact the logic could be simpler and
cleaner if directly handled by the revlog docket. Before we can do so, we need
to teach the revlog code about reading "pending" changes. To be honest, we
already needed some special casing of the .a postfix, so this does not adds
much complexity.

The logic around -writing- the special '00changelog.i.a' remains in the
changelog class. Note that the revlog-v2 logic no longer use this logic.

The only remaining user of the postfix argument is the censor logic. We
could probably also make the revlog full aware of it (most of the code is
already implemented in revlog anyway) and get rid of the postfix argument and
logic. However this is an adventure for another time.

Since we have more information, we add more, paranoid, Programming error in case
we detect such "pending reader" trying to do a read (which does not happens
anyways).

Diff Detail

Repository
rHG Mercurial
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

marmoute created this revision.May 3 2021, 7:55 AM
baymax updated this revision to Diff 27473.May 3 2021, 9:32 PM

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

baymax updated this revision to Diff 27876.May 11 2021, 1:44 PM

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

Alphare accepted this revision.May 17 2021, 5:48 PM
This revision is now accepted and ready to land.May 17 2021, 5:48 PM