Patchwork [2,of,4] tests: use debuginstall to retrieve hg version

login
register
mail settings
Submitter timeless
Date May 11, 2016, 5:23 a.m.
Message ID <9cd2f021a0de791a9b58.1462944202@gcc2-power8.osuosl.org>
Download mbox | patch
Permalink /patch/15006/
State Superseded, archived
Headers show

Comments

timeless - May 11, 2016, 5:23 a.m.
# HG changeset patch
# User timeless <timeless@mozdev.org>
# Date 1462920746 0
#      Tue May 10 22:52:26 2016 +0000
# Node ID 9cd2f021a0de791a9b58d820271553814c76ab18
# Parent  8c51b867ca30b264bc55047986e4de25edb3ef75
# EXP-Topic runtests
# Available At bb://timeless/mercurial-crew
#              hg pull bb://timeless/mercurial-crew -r 9cd2f021a0de
tests: use debuginstall to retrieve hg version
timeless - May 11, 2016, 2:33 p.m.
I'll resend this.

It should be hg debuginstall -T "{hgver}" ... I forgot that the
advantage of teaching debuginstall -T is that one can actually do
useful stuff with it.

On Wed, May 11, 2016 at 1:23 AM, timeless <timeless@fmr.im> wrote:
> # HG changeset patch
> # User timeless <timeless@mozdev.org>
> # Date 1462920746 0
> #      Tue May 10 22:52:26 2016 +0000
> # Node ID 9cd2f021a0de791a9b58d820271553814c76ab18
> # Parent  8c51b867ca30b264bc55047986e4de25edb3ef75
> # EXP-Topic runtests
> # Available At bb://timeless/mercurial-crew
> #              hg pull bb://timeless/mercurial-crew -r 9cd2f021a0de
> tests: use debuginstall to retrieve hg version
>
> diff -r 8c51b867ca30 -r 9cd2f021a0de tests/test-extension.t
> --- a/tests/test-extension.t    Tue May 10 22:45:45 2016 +0000
> +++ b/tests/test-extension.t    Tue May 10 22:52:26 2016 +0000
> @@ -958,8 +958,9 @@
>    ** Extensions loaded: throw, older
>
>  Declare the version as supporting this hg version, show regular bts link:
> -  $ hgver=`$PYTHON -c 'from mercurial import util; print util.version().split("+")[0]'`
> -  $ echo 'testedwith = """'"$hgver"'"""' >> throw.py
> +  $ hgver=`hg debuginstall -Tjson |egrep '"hgver":'| \
> +  >   sed -e 's/.*:\s*//;s/,.*//'|cat`
> +  $ echo 'testedwith = ""'$hgver'""' >> throw.py
>    $ if [ -z "$hgver" ]; then
>    >   echo "unable to fetch a mercurial version. Make sure __version__ is correct";
>    > fi
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel@mercurial-scm.org
> https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel

Patch

diff -r 8c51b867ca30 -r 9cd2f021a0de tests/test-extension.t
--- a/tests/test-extension.t	Tue May 10 22:45:45 2016 +0000
+++ b/tests/test-extension.t	Tue May 10 22:52:26 2016 +0000
@@ -958,8 +958,9 @@ 
   ** Extensions loaded: throw, older
 
 Declare the version as supporting this hg version, show regular bts link:
-  $ hgver=`$PYTHON -c 'from mercurial import util; print util.version().split("+")[0]'`
-  $ echo 'testedwith = """'"$hgver"'"""' >> throw.py
+  $ hgver=`hg debuginstall -Tjson |egrep '"hgver":'| \
+  >   sed -e 's/.*:\s*//;s/,.*//'|cat`
+  $ echo 'testedwith = ""'$hgver'""' >> throw.py
   $ if [ -z "$hgver" ]; then
   >   echo "unable to fetch a mercurial version. Make sure __version__ is correct";
   > fi