Patchwork tests: allow more flexibility in git diffstat output

login
register
mail settings
Submitter Mathias De Maré
Date Dec. 13, 2014, 3:40 p.m.
Message ID <eaf33fff7f2c31a5cc57.1418485244@mathias-Latitude-E6540>
Download mbox | patch
Permalink /patch/7075/
State Superseded
Commit 8b5adc6b72aebddbc51f5f9c95d38095aa3372f2
Headers show

Comments

Mathias De Maré - Dec. 13, 2014, 3:40 p.m.
# HG changeset patch
# User Mathias De Maré <mathias.demare@gmail.com>
# Date 1418460300 -3600
#      Sam Dez 13 09:45:00 2014 +0100
# Node ID eaf33fff7f2c31a5cc57b95898255221b0e3dc6f
# Parent  495bc1b65d25872324a0220354f048b220304bd1
tests: allow more flexibility in git diffstat output

The output of 'git diff --stat' changed in git 1.7.10 and 1.7.11.
To ensure the tests work with earlier versions of git as well,
the output is now wrapped with a whitespace regex.
Pierre-Yves David - Dec. 13, 2014, 8:06 p.m.
On 12/13/2014 07:40 AM, Mathias De Maré wrote:
> # HG changeset patch
> # User Mathias De Maré <mathias.demare@gmail.com>
> # Date 1418460300 -3600
> #      Sam Dez 13 09:45:00 2014 +0100
> # Node ID eaf33fff7f2c31a5cc57b95898255221b0e3dc6f
> # Parent  495bc1b65d25872324a0220354f048b220304bd1
> tests: allow more flexibility in git diffstat output

Pushed to the clowncopter, thanks.

>
> The output of 'git diff --stat' changed in git 1.7.10 and 1.7.11.
> To ensure the tests work with earlier versions of git as well,
> the output is now wrapped with a whitespace regex.
>
> diff --git a/tests/test-subrepo-git.t b/tests/test-subrepo-git.t
> --- a/tests/test-subrepo-git.t
> +++ b/tests/test-subrepo-git.t
> @@ -767,18 +767,21 @@ add new changes, including whitespace
>     +++ b/s/foobar
>     @@ -1,4 +1,4 @@
>     -woopwoop
>     +woop    woop
>
>      foo
>      bar (no-eol)
>
> +execute a diffstat
> +the output contains a regex, because git 1.7.10 and 1.7.11
> + change the amount of whitespace
>     $ hg diff --subrepos --stat
> -  barfoo | 1 +
> -   foobar | 2 +-
> +  \s*barfoo |\s*1 + (re)
> +  \s*foobar |\s*2 +- (re)
>      2 files changed, 2 insertions(+), 1 deletion(-) (no-eol)
>
>   ensure adding include/exclude ignores the subrepo
>     $ hg diff --subrepos -I s/foobar
>     $ hg diff --subrepos -X s/foobar
>
>     $ cd ..
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel@selenic.com
> http://selenic.com/mailman/listinfo/mercurial-devel
>

Patch

diff --git a/tests/test-subrepo-git.t b/tests/test-subrepo-git.t
--- a/tests/test-subrepo-git.t
+++ b/tests/test-subrepo-git.t
@@ -767,18 +767,21 @@  add new changes, including whitespace
   +++ b/s/foobar
   @@ -1,4 +1,4 @@
   -woopwoop
   +woop    woop
    
    foo
    bar (no-eol)
 
+execute a diffstat
+the output contains a regex, because git 1.7.10 and 1.7.11
+ change the amount of whitespace
   $ hg diff --subrepos --stat
-  barfoo | 1 +
-   foobar | 2 +-
+  \s*barfoo |\s*1 + (re)
+  \s*foobar |\s*2 +- (re)
    2 files changed, 2 insertions(+), 1 deletion(-) (no-eol)
 
 ensure adding include/exclude ignores the subrepo
   $ hg diff --subrepos -I s/foobar
   $ hg diff --subrepos -X s/foobar
 
   $ cd ..