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

Steven Brown stevengbrown at gmail.com
Sat Jun 18 07:04:57 CDT 2011


On 18 June 2011 19:10, Pierre-Yves David <pierre-yves.david at ens-lyon.org> 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")
> +        ui.warn(_(msg % util.version()))
> +        msg = _("       It requires feature '%s'.\n")
>         ui.warn(_(msg % inst.missing))
>         m = _("(see http://mercurial.selenic.com/wiki/RequiresFile for details)\n")
>         ui.warn(m)
> diff -r d162b12a93d0 -r fb1caa6ef368 tests/test-commit.t
> --- a/tests/test-commit.t       Sat Jun 18 11:40:48 2011 +0200
> +++ b/tests/test-commit.t       Sat Jun 18 11:51:33 2011 +0200
> @@ -98,7 +98,8 @@
>   $ echo foo >> foo
>   $ echo fake >> .hg/requires
>   $ hg commit -m bla
> -  abort: unknown repository format: requires feature 'fake'
> +  abort: mercurial 1.8.4+158-bb7e9bbe26ef+20110618 can not read this repository!

Still have a hard-coded version number here, although the next patch
in the series fixes it.

> +         It requires feature 'fake'.
>   (see http://mercurial.selenic.com/wiki/RequiresFile for details)
>   [255]
>
> diff -r d162b12a93d0 -r fb1caa6ef368 tests/test-identify.t
> --- a/tests/test-identify.t     Sat Jun 18 11:40:48 2011 +0200
> +++ b/tests/test-identify.t     Sat Jun 18 11:51:33 2011 +0200
> @@ -107,13 +107,15 @@
>
>   $ echo fake >> .hg/requires
>   $ hg id
> -  abort: unknown repository format: requires feature 'fake'
> +  abort: mercurial \d+.\d+.\d+[-+0-9a-f]* can not read this repository! (re)
> +         It requires feature 'fake'.
>   (see http://mercurial.selenic.com/wiki/RequiresFile for details)
>   [255]
>
>   $ cd ..
>   $ hg id test
> -  abort: unknown repository format: requires feature 'fake'
> +  abort: mercurial \d+.\d+.\d+[-+0-9a-f]* can not read this repository! (re)
> +         It requires feature 'fake'.
>   (see http://mercurial.selenic.com/wiki/RequiresFile for details)
>   [255]
>
> diff -r d162b12a93d0 -r fb1caa6ef368 tests/test-requires.t
> --- a/tests/test-requires.t     Sat Jun 18 11:40:48 2011 +0200
> +++ b/tests/test-requires.t     Sat Jun 18 11:51:33 2011 +0200
> @@ -9,6 +9,7 @@
>   [255]
>   $ echo indoor-pool > .hg/requires
>   $ hg tip
> -  abort: unknown repository format: requires feature 'indoor-pool'
> +  abort: mercurial \d+.\d+.\d+[-+0-9a-f]* can not read this repository! (re)
> +         It requires feature 'indoor-pool'.
>   (see http://mercurial.selenic.com/wiki/RequiresFile for details)
>   [255]
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel at selenic.com
> http://selenic.com/mailman/listinfo/mercurial-devel
>


More information about the Mercurial-devel mailing list