( )⚙ D4828 repo: move unfiltered-repo optimization to workingctx

This is an archive of the discontinued Mercurial Phabricator instance.

repo: move unfiltered-repo optimization to workingctx
ClosedPublic

Authored by martinvonz on Oct 1 2018, 6:23 PM.

Details

Summary

localrepo.getitem special-cased lookup of the working copy parent
to avoid looking up obsmarkers. I think the reason for that code
(which I once wrote myself) was to make hg commit not load
obsmarkers, which it would otherwise do via ctx.p1() in
localrepo.commitctx().

That had the somewhat unfortunate consequence of making lookup of an
unrelated binary nodeid load the dirstate. Now that changectx's
constructor is dumb, we can let workingctx._parents() have the
opmtimization instead.

This affects two tests, because they no longer end up loading the
dirstate and their "warning: ignoring unknown working parent ..."
messages therefore go way.

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

martinvonz created this revision.Oct 1 2018, 6:23 PM
This revision was automatically updated to reflect the committed changes.