[PATCH 4 of 6] require: include current mercurial version number in error message

Wagner Bruna wagner.bruna+mercurial at gmail.com
Sat Jun 18 09:10:13 CDT 2011


Pierre-Yves David wrote:
> # HG changeset patch
> # User Pierre-Yves David <pierre-yves.david at ens-lyon.org>
> # Date 1308390693 -7200
> # Node ID fb1caa6ef3682bf9471fb7fb8bc1ed6e8bc420c8
> # Parent  d162b12a93d0cd8c1ca0c1fcf391f99e600df41e
> require: include current mercurial version number in error message
> 
> Adding the current mercurial version number make it clearer that the issue is an
> outdated mercurial client.
> 
> diff -r d162b12a93d0 -r fb1caa6ef368 mercurial/dispatch.py
> --- a/mercurial/dispatch.py	Sat Jun 18 11:40:48 2011 +0200
> +++ b/mercurial/dispatch.py	Sat Jun 18 11:51:33 2011 +0200
> @@ -124,7 +124,9 @@
>              ui.warn(_("hg: %s\n") % inst.args[1])
>              commands.help_(ui, 'shortlist')
>      except error.MissingRequirementError, inst:
> -        msg = _("abort: unknown repository format: requires feature '%s'\n")
> +        msg = _("abort: mercurial %s can not read this repository!\n")

'Mercurial' here should be capitalized; see
http://mercurial.selenic.com/wiki/ProductName .

> +        ui.warn(_(msg % util.version()))
> +        msg = _("       It requires feature '%s'.\n")

Since the messages will be translated separately, it won't be
clear for translators that this spacing must be the length of
'abort: ', and that 'It' refers to 'Mercurial %s'. Translation
hints could be added for that, but I'm not sure it is worth
the trouble; it'd be easier to simply avoid splitting the
message.

Regards,
Wagner

>          ui.warn(_(msg % inst.missing))
>          m = _("(see http://mercurial.selenic.com/wiki/RequiresFile for details)\n")
>          ui.warn(m)


More information about the Mercurial-devel mailing list