changeset 13393:d38d500deb08

dispatch: debug message for missing arguments in shell alias Shows debug message if alias definition contains substitution variables, but insufficient number of arguments supplied.
author Roman Sokolov <sokolov.r.v@gmail.com>
date Fri, 11 Feb 2011 03:46:28 +0300
parents 777cef34a890
children 30e103dacd5f
files mercurial/dispatch.py
diffstat 1 files changed, 3 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/dispatch.py	Fri Feb 11 03:32:40 2011 +0300
+++ b/mercurial/dispatch.py	Fri Feb 11 03:46:28 2011 +0300
@@ -226,6 +226,9 @@
                     elif int(m.groups()[0]) <= len(args):
                         return m.group()
                     else:
+                        ui.debug(_("No argument found for substitution"
+                                   "of %i variable in alias '%s' definition.")
+                                 % (int(m.groups()[0]), self.name))
                         return ''
                 cmd = re.sub(r'\$(\d+|\$)', _checkvar, self.definition[1:])
                 replace = dict((str(i + 1), arg) for i, arg in enumerate(args))