From patchwork Sun Dec 14 13:17:24 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: tests: avoid git diffstat singular/plural output difference From: =?utf-8?q?Mathias_De_Mar=C3=A9?= X-Patchwork-Id: 7084 Message-Id: <4ab53fa684e3891a5228.1418563044@mathias-Latitude-E6540> To: mercurial-devel@selenic.com Cc: mharbison72@gmail.com Date: Sun, 14 Dec 2014 14:17:24 +0100 # HG changeset patch # User Mathias De Maré # Date 1418561696 -3600 # Son Dez 14 13:54:56 2014 +0100 # Node ID 4ab53fa684e3891a5228cc1e0ed7c187547d9d65 # Parent ec09f3c6c9a94b92e58adaf0f26f7009cc75cb94 tests: avoid git diffstat singular/plural output difference 'git diff --stat' output changed with regard to the amount of changes/insertions/deletions shown. In older git versions (1.7.7.6), output was shown as: 2 files changed, 2 insertions(+), 1 deletions(-) In newer versions, output is shown as: 2 files changed, 2 insertions(+), 1 deletion(-) The test was changed to execute 2 deletions, which avoids the difference in behaviour in older and newer git versions. 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 @@ -741,47 +741,55 @@ check output when diffing something else +fd4dbf828a5b2fcd36b2bcf21ea773820970d129 s add new changes, including whitespace $ cd s $ cat > foobar << EOF > woop woop > > foo - > bar > EOF $ echo foo > barfoo $ git add barfoo $ cd .. $ hg diff --subrepos --ignore-all-space diff --git a/s/barfoo b/s/barfoo new file mode 100644 index 0000000..257cc56 --- /dev/null +++ b/s/barfoo @@ -0,0 +1 @@ - +foo (no-eol) + +foo + diff --git a/s/foobar b/s/foobar + index 8a5a5e2..2bdff56 100644 + --- a/s/foobar + +++ b/s/foobar + @@ -1,4 +1,3 @@ + woop woop + + foo + -bar (no-eol) $ hg diff --subrepos s/foobar diff --git a/s/foobar b/s/foobar - index 8a5a5e2..bd5812a 100644 + index 8a5a5e2..2bdff56 100644 --- a/s/foobar +++ b/s/foobar - @@ -1,4 +1,4 @@ + @@ -1,4 +1,3 @@ -woopwoop +woop woop foo - bar (no-eol) + -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 \s*barfoo |\s*1 + (re) \s*foobar |\s*2 +- (re) - 2 files changed, 2 insertions(+), 1 deletion(-) (no-eol) + 2 files changed, 2 insertions(+), 2 deletions(-) (no-eol) ensure adding include/exclude ignores the subrepo $ hg diff --subrepos -I s/foobar $ hg diff --subrepos -X s/foobar $ cd ..