# HG changeset patch # User Gregory Szorc # Date 2015-02-07 06:52:40 # Node ID e8046ca0405d34ed8e510e916e984ac6d357ce5c # Parent b53d2afd11fbf13a44743af8b3c90ac2106fd510 webcommands: define a dict of available commands This will be used to hook web commands up to the help system. It also makes web commands work similarly as CLI commands. diff --git a/mercurial/hgweb/webcommands.py b/mercurial/hgweb/webcommands.py --- a/mercurial/hgweb/webcommands.py +++ b/mercurial/hgweb/webcommands.py @@ -20,6 +20,7 @@ from mercurial.error import ParseError, from mercurial import revset __all__ = [] +commands = {} class webcommand(object): """Decorator used to register a web command handler. @@ -39,6 +40,7 @@ class webcommand(object): def __call__(self, func): __all__.append(self.name) + commands[self.name] = func return func @webcommand('log')