##// END OF EJS Templates
alias: fix loss of non-zero return code in command aliases...
Yuya Nishihara -
r21556:5e13507a stable
parent child Browse files
Show More
@@ -445,7 +445,7 b' class cmdalias(object):'
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))
@@ -4,6 +4,7 b''
4 > # should clobber ci but not commit (issue2993)
4 > # should clobber ci but not commit (issue2993)
5 > ci = version
5 > ci = version
6 > myinit = init
6 > myinit = init
7 > mycommit = commit
7 > optionalrepo = showconfig alias.myinit
8 > optionalrepo = showconfig alias.myinit
8 > cleanstatus = status -c
9 > cleanstatus = status -c
9 > unknown = bargle
10 > unknown = bargle
@@ -41,6 +42,7 b''
41 > escaped2 = !sh -c 'echo "HGFOO is \$\$HGFOO"'
42 > escaped2 = !sh -c 'echo "HGFOO is \$\$HGFOO"'
42 > escaped3 = !sh -c 'echo "\$1 is \$\$\$1"'
43 > escaped3 = !sh -c 'echo "\$1 is \$\$\$1"'
43 > escaped4 = !printf '\$\$0 \$\$@\n'
44 > escaped4 = !printf '\$\$0 \$\$@\n'
45 > exit1 = !sh -c 'exit 1'
44 >
46 >
45 > [defaults]
47 > [defaults]
46 > mylog = -q
48 > mylog = -q
@@ -58,6 +60,7 b' unknown'
58
60
59 $ hg unknown
61 $ hg unknown
60 alias 'unknown' resolves to unknown command 'bargle'
62 alias 'unknown' resolves to unknown command 'bargle'
63 [1]
61 $ hg help unknown
64 $ hg help unknown
62 alias 'unknown' resolves to unknown command 'bargle'
65 alias 'unknown' resolves to unknown command 'bargle'
63
66
@@ -66,6 +69,7 b' ambiguous'
66
69
67 $ hg ambiguous
70 $ hg ambiguous
68 alias 'ambiguous' resolves to ambiguous command 's'
71 alias 'ambiguous' resolves to ambiguous command 's'
72 [1]
69 $ hg help ambiguous
73 $ hg help ambiguous
70 alias 'ambiguous' resolves to ambiguous command 's'
74 alias 'ambiguous' resolves to ambiguous command 's'
71
75
@@ -74,6 +78,7 b' recursive'
74
78
75 $ hg recursive
79 $ hg recursive
76 alias 'recursive' resolves to unknown command 'recursive'
80 alias 'recursive' resolves to unknown command 'recursive'
81 [1]
77 $ hg help recursive
82 $ hg help recursive
78 alias 'recursive' resolves to unknown command 'recursive'
83 alias 'recursive' resolves to unknown command 'recursive'
79
84
@@ -82,6 +87,7 b' no definition'
82
87
83 $ hg nodef
88 $ hg nodef
84 no definition for alias 'nodefinition'
89 no definition for alias 'nodefinition'
90 [1]
85 $ hg help nodef
91 $ hg help nodef
86 no definition for alias 'nodefinition'
92 no definition for alias 'nodefinition'
87
93
@@ -90,22 +96,27 b' invalid options'
90
96
91 $ hg no--cwd
97 $ hg no--cwd
92 error in definition for alias 'no--cwd': --cwd may only be given on the command line
98 error in definition for alias 'no--cwd': --cwd may only be given on the command line
99 [1]
93 $ hg help no--cwd
100 $ hg help no--cwd
94 error in definition for alias 'no--cwd': --cwd may only be given on the command line
101 error in definition for alias 'no--cwd': --cwd may only be given on the command line
95 $ hg no-R
102 $ hg no-R
96 error in definition for alias 'no-R': -R may only be given on the command line
103 error in definition for alias 'no-R': -R may only be given on the command line
104 [1]
97 $ hg help no-R
105 $ hg help no-R
98 error in definition for alias 'no-R': -R may only be given on the command line
106 error in definition for alias 'no-R': -R may only be given on the command line
99 $ hg no--repo
107 $ hg no--repo
100 error in definition for alias 'no--repo': --repo may only be given on the command line
108 error in definition for alias 'no--repo': --repo may only be given on the command line
109 [1]
101 $ hg help no--repo
110 $ hg help no--repo
102 error in definition for alias 'no--repo': --repo may only be given on the command line
111 error in definition for alias 'no--repo': --repo may only be given on the command line
103 $ hg no--repository
112 $ hg no--repository
104 error in definition for alias 'no--repository': --repository may only be given on the command line
113 error in definition for alias 'no--repository': --repository may only be given on the command line
114 [1]
105 $ hg help no--repository
115 $ hg help no--repository
106 error in definition for alias 'no--repository': --repository may only be given on the command line
116 error in definition for alias 'no--repository': --repository may only be given on the command line
107 $ hg no--config
117 $ hg no--config
108 error in definition for alias 'no--config': --config may only be given on the command line
118 error in definition for alias 'no--config': --config may only be given on the command line
119 [1]
109
120
110 optional repository
121 optional repository
111
122
@@ -125,6 +136,7 b' no usage'
125
136
126 $ hg nousage
137 $ hg nousage
127 no rollback information available
138 no rollback information available
139 [1]
128
140
129 $ echo foo > foo
141 $ echo foo > foo
130 $ hg commit -Amfoo
142 $ hg commit -Amfoo
@@ -442,3 +454,11 b" This shouldn't:"
442 $ hg --config alias.log='id' history
454 $ hg --config alias.log='id' history
443
455
444 $ cd ../..
456 $ cd ../..
457
458 return code of command and shell aliases:
459
460 $ hg mycommit -R alias
461 nothing changed
462 [1]
463 $ hg exit1
464 [1]
General Comments 0
You need to be logged in to leave comments. Login now