hg: wrap the highest layer in the `hg` script possible in trace event
This should help us have a better idea of what "interpreter startup
costs" look like. This does omit the HGUNICODEPEDANTRY block and the
LIBDIR dancing to set up sys.path, but the former is usually off and
the latter is unavoidable and should be very fast. If we get worried
about those cases we can consider open-coding the tracing logic here.
Differential Revision: https://phab.mercurial-scm.org/D4346
localrepo: use urllocalpath() for path to create repo too
It looks like this was lost in
7ce9dea3a14a (localrepo: move repo
creation logic out of localrepository.__init__ (API), 2018-09-11). I
don't know when it makes a difference (maybe on Windows, since
urllocalpath() mentions something about drive letters).
Differential Revision: https://phab.mercurial-scm.org/D4550
localrepo: move check for existing repo into createrepository()
For symmetry with the check for existence of a repo in
localrepository.__init__, we should check for the non-existence in
createrepository(). We could alternatively move both checks into
instance().
Differential Revision: https://phab.mercurial-scm.org/D4549
py3: add b'' to some run-tests.py strings for Windows
Things go seriously off the rails after this, so there may be more that are
missing.
# skip-blame since these are just converting to bytes literals
wireprotov1peer: forward __name__ of wrapped method in batchable decorator
Not required, but clarifies debugging when the going gets really tough.
Differential Revision: https://phab.mercurial-scm.org/D4551
templatekw: add {size} keyword as an example of fctx-based keyword
I'll add {status}, and I think some lfs keywords can be migrated to this.
I'm not certain how many fctx-based keywords will be introduced into the
global space, but if there are a couple more, we'll probably need to sort
them out to the "File Keywords" section in the templater help. Until then,
fctx keywords are hidden as experimental.
formatter: populate fctx from ctx and path value
Tests will be added by the next patch.
formatter: factor out function that detects node change and document it
This prepares for demand loading of ctx/fctx objects. With this change,
'revcache' is also recreated if 'node' value changes, which will be needed
to support loading of ctx from (repo, node) pair.