[PATCH 3 of 4] extensions: add docstring for wrapcommand()

Dan Villiom Podlaski Christiansen danchr at gmail.com
Wed Jul 7 05:18:50 CDT 2010


# HG changeset patch
# User Dan Villiom Podlaski Christiansen <danchr at gmail.com>
# Date 1278495510 -7200
# Node ID 2acf029768ae99af4746fd3a425564c168d4e601
# Parent  94f7469435b28e867861e0edd8da8dcccfd2e67e
extensions: add docstring for wrapcommand().

diff --git a/mercurial/extensions.py b/mercurial/extensions.py
--- a/mercurial/extensions.py
+++ b/mercurial/extensions.py
@@ -104,6 +104,18 @@ def loadall(ui):
                 extsetup() # old extsetup with no ui argument
 
 def wrapcommand(table, command, wrapper):
+    '''Wrap the command named `command' in table
+
+    It is replacing with your 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:


More information about the Mercurial-devel mailing list