hg: establish a cache for localrepository instances
hgweb contained code for determining whether a cached localrepository
instance was up to date. This code was way too low-level to be in
hgweb.
This functionality has been moved to a new "cachedlocalrepo" class
in hg.py. The code has been changed slightly to facilitate use
inside a class. hgweb has been refactored to use the new API.
As part of this refactor, hgweb.repo no longer exists! We're very close
to using a distinct repo instance per thread.
The new cache records state when it is created. This intelligence
prevents an extra localrepository from being created on the first
hgweb request. This is why some redundant output from test-extension.t
has gone away.
hgweb: create function to perform actions on new repo
We perform some common tasks when a new repo instance is obtained. In
preparation for changing how we obtain repo instances, factor this
functionality into a standalone function.
hgweb: remove proxy to hgweb instance
We were temporarily routing attributes until all request-specific
attributes from hgweb were moved to requestcontext. We have finally
reached that juncture and we can remove the proxy.
At this point, only the repo instance is prone to race conditions
between threads. This will be dealt with shortly.
dispatch: disable demandimport when invoking the debugger
Turns out that demandimport confuses pudb, which does some pretty
complicated imports. I think it's reasonable to disable demandimport
here.
templater: create string unescape helper (
issue4798)
This gives us a unified place to do error-handling of string-escaping
syntax errors
parsers: use PyTuple_New and SET_ITEM to construct metadata pair of markers
With these 2 patches, fm1readmarkers() gets slightly faster:
obsolete._fm1readmarkers() for 78644 entries
58.0 -> 56.2msec
parsers: use PyTuple_SET_ITEM() to fill new marker tuples
Because we know these tuples have no member yet, PyTuple_SetItem() isn't
necessary.
revset: uncache filteredset.__contains__
Since
96b6b3d78697, condition function returns a cached value, so there's
little benefit to cache __contains__.
No measurable difference found in contrib/base-revsets.txt.