comparison mercurial/dispatch.py @ 12093:cd895084a4cd

alias: on --debug, print expansion when it has invalid arguments
author Brodie Rao <brodie@bitheap.org>
date Fri, 27 Aug 2010 20:45:18 -0400
parents 4982fa38e544
children 0c605364373c
comparison
equal deleted inserted replaced
12092:4982fa38e544 12093:cd895084a4cd
291 (self.name, self.cmdname)) 291 (self.name, self.cmdname))
292 292
293 if self.definition.startswith('!'): 293 if self.definition.startswith('!'):
294 return self.fn(ui, *args, **opts) 294 return self.fn(ui, *args, **opts)
295 else: 295 else:
296 return util.checksignature(self.fn)(ui, *args, **opts) 296 try:
297 util.checksignature(self.fn)(ui, *args, **opts)
298 except error.SignatureError:
299 args = ' '.join([self.cmdname] + self.args)
300 ui.debug("alias '%s' expands to '%s'\n" % (self.name, args))
301 raise
297 302
298 def addaliases(ui, cmdtable): 303 def addaliases(ui, cmdtable):
299 # aliases are processed after extensions have been loaded, so they 304 # aliases are processed after extensions have been loaded, so they
300 # may use extension commands. Aliases can also use other alias definitions, 305 # may use extension commands. Aliases can also use other alias definitions,
301 # but only if they have been defined prior to the current definition. 306 # but only if they have been defined prior to the current definition.