changeset 11519:bbdf1fb1d3e3 stable

extensions: add docstring for wrapcommand().
author Dan Villiom Podlaski Christiansen <danchr@gmail.com>
date Fri, 09 Jul 2010 10:57:57 +0200
parents 8d827f4a23f1
children 94b3bbc886cf
files mercurial/extensions.py
diffstat 1 files changed, 12 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/extensions.py	Fri Jul 09 13:31:37 2010 +0200
+++ b/mercurial/extensions.py	Fri Jul 09 10:57:57 2010 +0200
@@ -104,6 +104,18 @@
                 extsetup() # old extsetup with no ui argument
 
 def wrapcommand(table, command, wrapper):
+    '''Wrap the command named `command' in table
+
+    Replace command in the command table with wrapper. The wrapped command will
+    be inserted into the command table specified by the table argument.
+
+    The wrapper will be called like
+
+      wrapper(orig, *args, **kwargs)
+
+    where orig is the original (wrapped) function, and *args, **kwargs
+    are the arguments passed to it.
+    '''
     aliases, entry = cmdutil.findcmd(command, table)
     for alias, e in table.iteritems():
         if e is entry: