##// END OF EJS Templates
dispatch: extract common logic for handling ParseError...
Jun Wu -
r28515:491eabd0 default
parent child Browse files
Show More
@@ -81,6 +81,8 b' def _formatparse(write, inst):'
81 81 else:
82 82 write(_("hg: parse error: %s\n") % inst.args[0])
83 83 _reportsimilar(write, similar)
84 if inst.hint:
85 write(_("(%s)\n") % inst.hint)
84 86
85 87 def dispatch(req):
86 88 "run the command specified in req.args"
@@ -111,8 +113,6 b' def dispatch(req):'
111 113 return -1
112 114 except error.ParseError as inst:
113 115 _formatparse(ferr.write, inst)
114 if inst.hint:
115 ferr.write(_("(%s)\n") % inst.hint)
116 116 return -1
117 117
118 118 msg = ' '.join(' ' in a and repr(a) or a for a in req.args)
@@ -208,8 +208,6 b' def _runcatch(req):'
208 208 (inst.args[0], " ".join(inst.args[1])))
209 209 except error.ParseError as inst:
210 210 _formatparse(ui.warn, inst)
211 if inst.hint:
212 ui.warn(_("(%s)\n") % inst.hint)
213 211 return -1
214 212 except error.LockHeld as inst:
215 213 if inst.errno == errno.ETIMEDOUT:
General Comments 0
You need to be logged in to leave comments. Login now