D4642: localrepo: iteratively derive local repository type
indygreg (Gregory Szorc)
phabricator at mercurial-scm.org
Mon Sep 24 15:34:42 UTC 2018
indygreg added a comment.
In https://phab.mercurial-scm.org/D4642#71269, @yuja wrote:
> > + Extensions should wrap these factory functions to customize repository type
> > + creation. Note that an extension's wrapped function may be called even if
> > + that extension is not loaded for the repo being constructed. Extensions
> > + should check if their ``__name__`` appears in the
> > + ``extensionmodulenames`` set passed to the factory function and no-op if
> > + not.
>
> I assume this will be revisited later. I think it's a source of bugs to
> relying on extensions to check if they are enabled. It's also cumbersome
> to wrap a function referenced from another table.
I agree it is not great and I hope to revisit this problem.
FWIW we have similar problems with `extensions.wrapfunction()`. Many function wrappings bury their head in the sand with regards to universal function wrapping in multi-repo contexts. e.g. in hgweb, repo A can load an extension which wraps a function. Repo B doesn't want that extension loaded but the process still has the function wrapped. I'm not sure how to best handle this :/
REPOSITORY
rHG Mercurial
REVISION DETAIL
https://phab.mercurial-scm.org/D4642
To: indygreg, #hg-reviewers
Cc: yuja, mercurial-devel
More information about the Mercurial-devel
mailing list