webcommands: define a dict of available commands
authorGregory Szorc <gregory.szorc@gmail.com>
Fri, 06 Feb 2015 22:52:40 -0800
changeset 24077 e8046ca0405d
parent 24076 b53d2afd11fb
child 24078 e44586d9c207
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.
mercurial/hgweb/webcommands.py
--- a/mercurial/hgweb/webcommands.py	Fri Feb 06 19:06:17 2015 -0800
+++ b/mercurial/hgweb/webcommands.py	Fri Feb 06 22:52:40 2015 -0800
@@ -20,6 +20,7 @@
 from mercurial import revset
 
 __all__ = []
+commands = {}
 
 class webcommand(object):
     """Decorator used to register a web command handler.
@@ -39,6 +40,7 @@
 
     def __call__(self, func):
         __all__.append(self.name)
+        commands[self.name] = func
         return func
 
 @webcommand('log')