Mercurial > hg
comparison mercurial/dispatch.py @ 21556:5e13507a3b4e stable
alias: fix loss of non-zero return code in command aliases
This also includes test for shell aliases. It avoid using "false" command
because "man false" does not say "exit with 1" but "exit with a status code
indicating failure."
author | Yuya Nishihara <yuya@tcha.org> |
---|---|
date | Sat, 17 May 2014 14:43:06 +0900 |
parents | 9a09a625bc93 |
children | c5afb07c33d3 |
comparison
equal
deleted
inserted
replaced
21547:565d45919db8 | 21556:5e13507a3b4e |
---|---|
443 | 443 |
444 if util.safehasattr(self, 'shell'): | 444 if util.safehasattr(self, 'shell'): |
445 return self.fn(ui, *args, **opts) | 445 return self.fn(ui, *args, **opts) |
446 else: | 446 else: |
447 try: | 447 try: |
448 util.checksignature(self.fn)(ui, *args, **opts) | 448 return util.checksignature(self.fn)(ui, *args, **opts) |
449 except error.SignatureError: | 449 except error.SignatureError: |
450 args = ' '.join([self.cmdname] + self.args) | 450 args = ' '.join([self.cmdname] + self.args) |
451 ui.debug("alias '%s' expands to '%s'\n" % (self.name, args)) | 451 ui.debug("alias '%s' expands to '%s'\n" % (self.name, args)) |
452 raise | 452 raise |
453 | 453 |