[PATCH 3 of 5] registrar: add decorator class to register a function as web command (API)

Yuya Nishihara yuya at tcha.org
Thu Aug 23 08:27:40 EDT 2018


On Wed, 22 Aug 2018 11:21:54 +0900, FUJIWARA Katsunori wrote:
> +    # delay importing webcommands, because it implies evaluation of
> +    # hgweb/__init__.py, even though web server feature is not used in
> +    # almost all client usecases
> +    def loadwebcommand(ui, extname, registrarobj):
> +        from .hgweb import webcommands
> +        webcommands.loadcommand(ui, extname, registrarobj)

Nit: if it's really expensive to import hgweb, we'll probably need to
move the slow parts out of hgweb/__init__.py.


More information about the Mercurial-devel mailing list