( )⚙ D10343 cg4: introduce protocol flag to signify the presence of sidedata

This is an archive of the discontinued Mercurial Phabricator instance.

cg4: introduce protocol flag to signify the presence of sidedata
ClosedPublic

Authored by Alphare on Apr 9 2021, 4:49 AM.

Details

Summary

We need a way of signaling whether the current revision has sidedata or not,
and re-using the revision flags would waste potential revlog flags and mix two
normally independent layers.

In this change, we add a single byte at the start of the ch4 delta header to
set potential protocol flags. We also reclaim the revlog flag for sidedata,
since it is no longer used, in its place now lives the (also experimental)
copytracing flag.

When generating deltas, apply the CG_FLAG_SIDEDATA flag if there is sidedata.
When applying the deltas, if said flag is present, the next chunk contains the
sidedata.

Diff Detail

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

Event Timeline

Alphare created this revision.Apr 9 2021, 4:49 AM
marmoute requested changes to this revision.Apr 9 2021, 6:09 AM
marmoute added a subscriber: marmoute.
marmoute added inline comments.
mercurial/changegroup.py
650

The revlog flag is no longer useful since the sidedata are now stored separately. Are we still using it in the revlog index ?

We should use another flag/variable defined for changegroup only for this purpose.

mercurial/helptext/internals/changegroups.txt
150–152

Maybe add a not about the fact it does not affect changegroup handling and will be relevant for other Mercurial operation ?

mercurial/revlogutils/constants.py
89–90

So, this should not be in relogutils.constants ;-) (see previous message)

This revision now requires changes to proceed.Apr 9 2021, 6:09 AM
Alphare retitled this revision from cg4: use revision flag to signify the presence of sidedata to cg4: introduce protocol flag to signify the presence of sidedata.Apr 10 2021, 3:14 PM
Alphare edited the summary of this revision. (Show Details)
Alphare updated this revision to Diff 26778.
Alphare marked 3 inline comments as done.Apr 10 2021, 3:20 PM
Alphare planned changes to this revision.
Alphare updated this revision to Diff 27032.Apr 19 2021, 6:09 AM
Alphare updated this revision to Diff 27099.Apr 20 2021, 9:38 AM
marmoute accepted this revision.Apr 22 2021, 1:45 PM
marmoute added inline comments.
hgext/remotefilelog/remotefilelog.py
339–340 ↗(On Diff #27099)

nits: The rest of the patchs seems to imply they are used. Am I missing something ?

marmoute requested changes to this revision.May 2 2021, 8:49 AM

This patch is currently failing tests/test-upgrade-repo.t

This revision now requires changes to proceed.May 2 2021, 8:49 AM
baymax updated this revision to Diff 27300.May 3 2021, 6:06 AM

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

marmoute accepted this revision.May 3 2021, 7:50 AM

Ci fixed, thanks.

baymax updated this revision to Diff 27450.May 3 2021, 9:01 PM

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

This revision was not accepted when it landed; it landed in state Needs Review.
This revision was automatically updated to reflect the committed changes.