[PATCH] extensions: allow replacing command synopsis

Ryan McElroy rm at fb.com
Tue Feb 10 21:43:12 CST 2015


# HG changeset patch
# User Ryan McElroy <rm at fb.com>
# Date 1423508565 28800
#      Mon Feb 09 11:02:45 2015 -0800
# Node ID dac1fbb56786c2033e188e7b762a9429cd7ff621
# Parent  ff5caa8dfd993680d9602ca6ebb14da9de10d5f4
extensions: allow replacing command synopsis

diff --git a/mercurial/extensions.py b/mercurial/extensions.py
--- a/mercurial/extensions.py
+++ b/mercurial/extensions.py
@@ -152,7 +152,7 @@ def afterloaded(extension, callback):
     else:
         _aftercallbacks.setdefault(extension, []).append(callback)
 
-def wrapcommand(table, command, wrapper):
+def wrapcommand(table, command, wrapper, synopsis=None):
     '''Wrap the command named `command' in table
 
     Replace command in the command table with wrapper. The wrapped command will
@@ -182,6 +182,8 @@ def wrapcommand(table, command, wrapper)
 
     newentry = list(entry)
     newentry[0] = wrap
+    if synopsis is not None:
+        newentry[2] = synopsis
     table[key] = tuple(newentry)
     return entry
 


More information about the Mercurial-devel mailing list