Mercurial > hg
comparison mercurial/dispatch.py @ 27516:1c1216182dc1
error: make ParseError inherit from HintException
author | timeless <timeless@mozdev.org> |
---|---|
date | Wed, 23 Dec 2015 17:39:32 +0000 |
parents | eadbbd14bdc1 |
children | 4030d3b79953 |
comparison
equal
deleted
inserted
replaced
27515:f8142cb77b1e | 27516:1c1216182dc1 |
---|---|
105 if inst.hint: | 105 if inst.hint: |
106 ferr.write(_("(%s)\n") % inst.hint) | 106 ferr.write(_("(%s)\n") % inst.hint) |
107 return -1 | 107 return -1 |
108 except error.ParseError as inst: | 108 except error.ParseError as inst: |
109 _formatparse(ferr.write, inst) | 109 _formatparse(ferr.write, inst) |
110 if inst.hint: | |
111 ferr.write(_("(%s)\n") % inst.hint) | |
110 return -1 | 112 return -1 |
111 | 113 |
112 msg = ' '.join(' ' in a and repr(a) or a for a in req.args) | 114 msg = ' '.join(' ' in a and repr(a) or a for a in req.args) |
113 starttime = time.time() | 115 starttime = time.time() |
114 ret = None | 116 ret = None |
200 except error.AmbiguousCommand as inst: | 202 except error.AmbiguousCommand as inst: |
201 ui.warn(_("hg: command '%s' is ambiguous:\n %s\n") % | 203 ui.warn(_("hg: command '%s' is ambiguous:\n %s\n") % |
202 (inst.args[0], " ".join(inst.args[1]))) | 204 (inst.args[0], " ".join(inst.args[1]))) |
203 except error.ParseError as inst: | 205 except error.ParseError as inst: |
204 _formatparse(ui.warn, inst) | 206 _formatparse(ui.warn, inst) |
207 if inst.hint: | |
208 ui.warn(_("(%s)\n") % inst.hint) | |
205 return -1 | 209 return -1 |
206 except error.LockHeld as inst: | 210 except error.LockHeld as inst: |
207 if inst.errno == errno.ETIMEDOUT: | 211 if inst.errno == errno.ETIMEDOUT: |
208 reason = _('timed out waiting for lock held by %s') % inst.locker | 212 reason = _('timed out waiting for lock held by %s') % inst.locker |
209 else: | 213 else: |