changeset 12092:4982fa38e544

alias: print what command is being shadowed in debug message
author Brodie Rao <brodie@bitheap.org>
date Fri, 27 Aug 2010 20:45:11 -0400
parents 339bd18c772f
children cd895084a4cd
files mercurial/dispatch.py
diffstat 1 files changed, 4 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/dispatch.py	Mon Aug 30 22:52:00 2010 +0200
+++ b/mercurial/dispatch.py	Fri Aug 27 20:45:11 2010 -0400
@@ -190,6 +190,7 @@
 class cmdalias(object):
     def __init__(self, name, definition, cmdtable):
         self.name = self.cmd = name
+        self.cmdname = ''
         self.definition = definition
         self.args = []
         self.opts = []
@@ -234,7 +235,7 @@
             return
 
         args = shlex.split(self.definition)
-        cmd = args.pop(0)
+        self.cmdname = cmd = args.pop(0)
         args = map(util.expandpath, args)
 
         for invalidarg in ("--cwd", "-R", "--repository", "--repo"):
@@ -286,7 +287,8 @@
 
     def __call__(self, ui, *args, **opts):
         if self.shadows:
-            ui.debug("alias '%s' shadows command\n" % self.name)
+            ui.debug("alias '%s' shadows command '%s'\n" %
+                     (self.name, self.cmdname))
 
         if self.definition.startswith('!'):
             return self.fn(ui, *args, **opts)