lfs: convert to using exthelper to wrap functions
I'm not 100% sure that upgraderequirements() can be double annotated safely, but
it seems OK based on printing the address of the function being wrapped.
One thing I've noticed is that @eh.reposetup doesn't do the usual check to
ensure that it's a local repo. Should that be baked into @eh.reposetup()
somehow, possibly with a non-default option to skip the check? It seems like a
gaping hole if every function that gets registered needs to add this check.
tests: convert a test extension to use exthelper
This provides test coverage to uipopulate().
exthelper: drop fileset/revset/template support for now
Yuya raised concerns about duplicating registrar functionality. There are a
couple of ideas to work around this, which would allow bringing them back, and
then backporting to evolve. For now, I just want to get the subsequent changes
landed before the bulk b'' rewrite makes rebasing too hard.
extensions: import the exthelper class from evolve
980565468003 (API)
This should help make extensions that wrap a lot of stuff more comprehendible.
It was copied unmodified, except:
- fix up the imports
- rename final_xxxsetup() -> finalxxxsetup() to appease checkcode
- avoid a [] default arg to wrapcommand()
.. api::
Add `exthelper` class to simplify extension writing by allowing functions,
commands, and configitems to be registered via annotations. The previous
APIs are still available for use.
narrow: detect if narrowspec was changed in a different share
With this commit, `hg share` should be usable with narrow
repos. Design explained on
https://www.mercurial-scm.org/wiki/NarrowSharePlan
I was running into cache invalidation problems when updating the
narrowspec. After spending a day trying to figure out a good solution,
I resorted to just assigning repo.narrowpats and repo._narrowmatch
after invalidating them.
Differential Revision: https://phab.mercurial-scm.org/D5278
tests: add test for narrow+share
For how narrow+share is supposed to work, see
https://www.mercurial-scm.org/wiki/NarrowSharePlan.
Differential Revision: https://phab.mercurial-scm.org/D5276
narrow: keep narrowspec backup in store
As suggested by Yuya in review of D4099.
Differential Revision: https://phab.mercurial-scm.org/D5470
tests: update narrowspec when narrowspec, not dirstate, is accessed
test-narrow-expanddirstate.t mimics a Google-internal extension that
updates the narrowspec whenever the dirstate is accessed. Since
1d09ba0d2ed3 (narrow: move remaining narrow-limited dirstate walks to
core, 2018-10-01) and a few commits before it, we no longer restrict
repo.dirstate.walk() to the narrowspec. It is instead done at a higher
level (e.g. context.status()). We were running into problems with the
Google-internal extension when importing those commits. The issue was
that the narrowspec was read before the first dirstate access. I
believe the right fix is to instead update the narrowspec when trying
to read it (not when reading the dirstate), so that's what this patch
does.
Differential Revision: https://phab.mercurial-scm.org/D5275
merge: extract helper for creating empty "actions" dict
Replicating the set of actions in multiple places is bad.
Differential Revision: https://phab.mercurial-scm.org/D5472