alias: on --debug, print expansion when it has invalid arguments
authorBrodie Rao <brodie@bitheap.org>
Fri, 27 Aug 2010 20:45:18 -0400
changeset 12093 cd895084a4cd
parent 12092 4982fa38e544
child 12094 1db76910f9b4
alias: on --debug, print expansion when it has invalid arguments
mercurial/dispatch.py
--- a/mercurial/dispatch.py	Fri Aug 27 20:45:11 2010 -0400
+++ b/mercurial/dispatch.py	Fri Aug 27 20:45:18 2010 -0400
@@ -293,7 +293,12 @@
         if self.definition.startswith('!'):
             return self.fn(ui, *args, **opts)
         else:
-            return util.checksignature(self.fn)(ui, *args, **opts)
+            try:
+                util.checksignature(self.fn)(ui, *args, **opts)
+            except error.SignatureError:
+                args = ' '.join([self.cmdname] + self.args)
+                ui.debug("alias '%s' expands to '%s'\n" % (self.name, args))
+                raise
 
 def addaliases(ui, cmdtable):
     # aliases are processed after extensions have been loaded, so they