This is an archive of the discontinued Mercurial Phabricator instance.

transaction: drop per-file extra data support
ClosedPublic

Authored by joerg.sonnenberger on Nov 7 2020, 4:31 PM.

Details

Summary

At the moment, transactions support an optional extra data argument for
all files to be stored in addition to the original offset. This is used
in core only by the revlog inline to external data migration. It is used
to memoize the number of revisions before the transaction. That number
of can be computed during the walk easily, so drop the requirement.

Diff Detail

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

Event Timeline

indygreg accepted this revision.Nov 7 2020, 5:38 PM

I _think_ this is safe. But I would appreciate an extra set of eyes on the changed code in revlog.py. Essentially what's happening here is we were previously stuffing the number of revisions in the revlog in the in-memory data structure so we could recover the inline revlog if we had to roll back a .i -> .d revlog split that was incurred as part of the transaction.

The key line not changed in this patch is tr.replace(self.indexfile, trindex * self._io.size). And the new code gradually incrementing trindex as long as we're processing entries earlier than the .i offset recorded in the transaction seems correct to me.

This revision is now accepted and ready to land.Nov 7 2020, 5:38 PM
This revision was automatically updated to reflect the committed changes.