comparison mercurial/dispatch.py @ 14761:1a9256cdf10f stable

error: Add a hint argument to RepoError This use the same mechanism than Abort. Except clause stay distinct because RepoError add "!" at the end of the message.
author Pierre-Yves David <pierre-yves.david@ens-lyon.org>
date Sat, 25 Jun 2011 02:30:17 +0200
parents 189a7562d72e
children 67add0f24f83 1c148e935244
comparison
equal deleted inserted replaced
14760:cebbc6b38c05 14761:1a9256cdf10f
123 else: 123 else:
124 ui.warn(_("hg: %s\n") % inst.args[1]) 124 ui.warn(_("hg: %s\n") % inst.args[1])
125 commands.help_(ui, 'shortlist') 125 commands.help_(ui, 'shortlist')
126 except error.RepoError, inst: 126 except error.RepoError, inst:
127 ui.warn(_("abort: %s!\n") % inst) 127 ui.warn(_("abort: %s!\n") % inst)
128 if inst.hint:
129 ui.warn(_("(%s)\n") % inst.hint)
128 except error.ResponseError, inst: 130 except error.ResponseError, inst:
129 ui.warn(_("abort: %s") % inst.args[0]) 131 ui.warn(_("abort: %s") % inst.args[0])
130 if not isinstance(inst.args[1], basestring): 132 if not isinstance(inst.args[1], basestring):
131 ui.warn(" %r\n" % (inst.args[1],)) 133 ui.warn(" %r\n" % (inst.args[1],))
132 elif not inst.args[1]: 134 elif not inst.args[1]: