changeset 24077:e8046ca0405d

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.
author Gregory Szorc <gregory.szorc@gmail.com>
date Fri, 06 Feb 2015 22:52:40 -0800
parents b53d2afd11fb
children e44586d9c207
files mercurial/hgweb/webcommands.py
diffstat 1 files changed, 2 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- 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')