[PATCH] commands: minor refactoring

Henri Wiechers hwiechers at gmail.com
Fri Nov 20 06:24:00 CST 2009


# HG changeset patch
# User Henri Wiechers <hwiechers at gmail.com>
# Date 1258719065 -7200
# Node ID cb2a1836c50a431ac68de27cbdb0ce835d2fc575
# Parent  b5170b8b32a5a8a77a9062da5726c0e4a667410d
commands: minor refactoring

Renamed local variable i to entry in helpcmd.

diff -r b5170b8b32a5 -r cb2a1836c50a mercurial/commands.py
--- a/mercurial/commands.py	Fri Nov 20 02:34:56 2009 +0100
+++ b/mercurial/commands.py	Fri Nov 20 14:11:05 2009 +0200
@@ -1476,7 +1476,7 @@
             ui.write('\n')
 
         try:
-            aliases, i = cmdutil.findcmd(name, table, False)
+            aliases, entry = cmdutil.findcmd(name, table, False)
         except error.AmbiguousCommand, inst:
             # py3k fix: except vars can't be used outside the scope of the
             # except block, nor can be used inside a lambda. python issue4617
@@ -1486,11 +1486,11 @@
             return
 
         # synopsis
-        if len(i) > 2:
-            if i[2].startswith('hg'):
-                ui.write("%s\n" % i[2])
+        if len(entry) > 2:
+            if entry[2].startswith('hg'):
+                ui.write("%s\n" % entry[2])
             else:
-                ui.write('hg %s %s\n' % (aliases[0], i[2]))
+                ui.write('hg %s %s\n' % (aliases[0], entry[2]))
         else:
             ui.write('hg %s\n' % aliases[0])
 
@@ -1499,7 +1499,7 @@
             ui.write(_("\naliases: %s\n") % ', '.join(aliases[1:]))
 
         # description
-        doc = gettext(i[0].__doc__)
+        doc = gettext(entry[0].__doc__)
         if not doc:
             doc = _("(no help text available)")
         if ui.quiet:
@@ -1508,8 +1508,8 @@
 
         if not ui.quiet:
             # options
-            if i[1]:
-                option_lists.append((_("options:\n"), i[1]))
+            if entry[1]:
+                option_lists.append((_("options:\n"), entry[1]))
 
             addglobalopts(False)
 


More information about the Mercurial-devel mailing list