tests: avoid git diffstat singular/plural output difference
authorMathias De Maré <mathias.demare@gmail.com>
Sun, 14 Dec 2014 21:00:58 +0100
changeset 23551 7651621507cf
parent 23550 7fa2189c1e87
child 23552 72319005f5fb
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.
tests/test-subrepo-git.t
--- a/tests/test-subrepo-git.t	Sun Dec 14 11:34:51 2014 +0100
+++ b/tests/test-subrepo-git.t	Sun Dec 14 21:00:58 2014 +0100
@@ -778,7 +778,7 @@
   $ 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