Summary: This would lead to less surprises than using the default priority.
Reviewed By: quark-zju
Differential Revision: D9818647
fbshipit-source-id: 59214eff84ea0b485ab8ff42b86df1c605a319f5
Summary:
Migrate builtin namespace definition to use the registrar. So we can deprecate
`addnamespace`.
`after` is not expressive enough in certain cases, although it's easier to
understand. Add a `priority` parameter for more explicit ordering handling.
Reviewed By: singhsrb
Differential Revision: D9780363
fbshipit-source-id: 85b9cfb91a7c937eea95f2a279a43c11e561b5fc
Summary:
Previously, there is no easy API to add a namespace with desired order. There
is `extensions.afterloaded`, but that only works for `ui/extsetup`, not for
`reposetup`.
This diff add a namespace predicate so registering a namespace is similar to
registering a revset. It also provides an optional `after` parameter to define
the desired order, like:
from mercurial import registrar, namespaces
namespacepredicate = registrar.namespacepredicate()
namespacepredicate("svn", after=["remotenames"])
def svn(repo):
return namespaces.namespace("svn", ...)
Existing namespaces will be migrated by upcoming changes.
This is useful for things wanting to resolve custom names, like globalrevs and
commit cloud.
Reviewed By: singhsrb
Differential Revision: D9775703
fbshipit-source-id: f15827b042d605b9cebc1ee1af6479903f47ee9c