Martin von Zweigbergk <martinvonz@google.com> [Mon, 01 Oct 2018 15:29:31 -0700] rev 39960
narrow: avoid looking up dirstate again when editing dirstate
The narrow extension overrides the dirstate editing functions to
restrict paths outside the narrowspec. These overrides access the
dirstate from repo.dirstate instead of using the "self" reference
passed to the overridden functions. I don't see a reason for this and
it caused me problems with a later patch (it caused infinite recursion
when I modified localrepo.dirstate()), so let's change it.
Differential Revision: https://phab.mercurial-scm.org/D4829
Martin von Zweigbergk <martinvonz@google.com> [Wed, 26 Sep 2018 23:09:28 -0700] rev 39959
repo: move unfiltered-repo optimization to workingctx
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.
Differential Revision: https://phab.mercurial-scm.org/D4828