[PATCH V2] tests: avoid git diffstat singular/plural output difference
Mathias De Maré
mathias.demare at gmail.com
Sun Dec 14 20:10:18 UTC 2014
# HG changeset patch
# User Mathias De Maré <mathias.demare at gmail.com>
# Date 1418587258 -3600
# Son Dez 14 21:00:58 2014 +0100
# Node ID 8ca2aa5000850fd114c30d34dc6248e57634c160
# Parent b1545533058401608b8e9eb4a6def860b56d3ca6
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(-)
This patch uses a regex to handle both cases.
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
@@ -773,23 +773,22 @@ add new changes, including whitespace
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\(\+\), 1 deletions?\(-\) \(no-eol\) (re)
ensure adding include/exclude ignores the subrepo
$ hg diff --subrepos -I s/foobar
$ hg diff --subrepos -X s/foobar
-
revert the subrepository
$ hg revert --all
reverting subrepo ../gitroot (glob)
../gitroot: reverting git subrepos without --no-backup is unsupported (glob)
$ hg status --subrepos
M s/foobar
A s/barfoo
More information about the Mercurial-devel
mailing list