Patchwork [2,of,3,stable] tests: work around differing hunk headers between GNU and Solaris diff

login
register
mail settings
Submitter Danek Duvall
Date July 20, 2015, 10:46 p.m.
Message ID <f578f809c667df19e548.1437432411@smelly.us.oracle.com>
Download mbox | patch
Permalink /patch/10045/
State Accepted
Commit 7316a2847c632612fb190d598798a75d3ea652f5
Headers show

Comments

Danek Duvall - July 20, 2015, 10:46 p.m.
# HG changeset patch
# User Danek Duvall <danek.duvall@oracle.com>
# Date 1437431955 25200
#      Mon Jul 20 15:39:15 2015 -0700
# Branch stable
# Node ID f578f809c667df19e54882cb5f535522d351ac2e
# Parent  2f68e10b2e83f5fe500664cb949b1adc5f07b037
tests: work around differing hunk headers between GNU and Solaris diff

The hunk headers specifying what lines the hunk apply to differ.  They're
irrelevant to the test, so just eliminate them from the output.

Patch

diff --git a/tests/test-command-template.t b/tests/test-command-template.t
--- a/tests/test-command-template.t
+++ b/tests/test-command-template.t
@@ -120,52 +120,32 @@  as default style, except for extra phase
   $ hg log --style default > style.out
   $ cmp log.out style.out || diff -u log.out style.out
   $ hg log -T phases > phases.out
-  $ diff -U 0 log.out phases.out | egrep -v '^---|^\+\+\+'
-  @@ -2,0 +3 @@
+  $ diff -U 0 log.out phases.out | egrep -v '^---|^\+\+\+|^@@'
   +phase:       draft
-  @@ -6,0 +8 @@
   +phase:       draft
-  @@ -11,0 +14 @@
   +phase:       draft
-  @@ -17,0 +21 @@
   +phase:       draft
-  @@ -24,0 +29 @@
   +phase:       draft
-  @@ -31,0 +37 @@
   +phase:       draft
-  @@ -36,0 +43 @@
   +phase:       draft
-  @@ -41,0 +49 @@
   +phase:       draft
-  @@ -46,0 +55 @@
   +phase:       draft
-  @@ -51,0 +61 @@
   +phase:       draft
 
   $ hg log -v > log.out
   $ hg log -v --style default > style.out
   $ cmp log.out style.out || diff -u log.out style.out
   $ hg log -v -T phases > phases.out
-  $ diff -U 0 log.out phases.out | egrep -v '^---|^\+\+\+'
-  @@ -2,0 +3 @@
+  $ diff -U 0 log.out phases.out | egrep -v '^---|^\+\+\+|^@@'
   +phase:       draft
-  @@ -7,0 +9 @@
   +phase:       draft
-  @@ -15,0 +18 @@
   +phase:       draft
-  @@ -24,0 +28 @@
   +phase:       draft
-  @@ -33,0 +38 @@
   +phase:       draft
-  @@ -43,0 +49 @@
   +phase:       draft
-  @@ -50,0 +57 @@
   +phase:       draft
-  @@ -58,0 +66 @@
   +phase:       draft
-  @@ -66,0 +75 @@
   +phase:       draft
-  @@ -77,0 +87 @@
   +phase:       draft
 
   $ hg log -q > log.out
@@ -212,52 +192,32 @@  Default style should also preserve color
   $ hg --color=debug log --style default > style.out
   $ cmp log.out style.out || diff -u log.out style.out
   $ hg --color=debug log -T phases > phases.out
-  $ diff -U 0 log.out phases.out | egrep -v '^---|^\+\+\+'
-  @@ -2,0 +3 @@
+  $ diff -U 0 log.out phases.out | egrep -v '^---|^\+\+\+|^@@'
   +[log.phase|phase:       draft]
-  @@ -6,0 +8 @@
   +[log.phase|phase:       draft]
-  @@ -11,0 +14 @@
   +[log.phase|phase:       draft]
-  @@ -17,0 +21 @@
   +[log.phase|phase:       draft]
-  @@ -24,0 +29 @@
   +[log.phase|phase:       draft]
-  @@ -31,0 +37 @@
   +[log.phase|phase:       draft]
-  @@ -36,0 +43 @@
   +[log.phase|phase:       draft]
-  @@ -41,0 +49 @@
   +[log.phase|phase:       draft]
-  @@ -46,0 +55 @@
   +[log.phase|phase:       draft]
-  @@ -51,0 +61 @@
   +[log.phase|phase:       draft]
 
   $ hg --color=debug -v log > log.out
   $ hg --color=debug -v log --style default > style.out
   $ cmp log.out style.out || diff -u log.out style.out
   $ hg --color=debug -v log -T phases > phases.out
-  $ diff -U 0 log.out phases.out | egrep -v '^---|^\+\+\+'
-  @@ -2,0 +3 @@
+  $ diff -U 0 log.out phases.out | egrep -v '^---|^\+\+\+|^@@'
   +[log.phase|phase:       draft]
-  @@ -7,0 +9 @@
   +[log.phase|phase:       draft]
-  @@ -15,0 +18 @@
   +[log.phase|phase:       draft]
-  @@ -24,0 +28 @@
   +[log.phase|phase:       draft]
-  @@ -33,0 +38 @@
   +[log.phase|phase:       draft]
-  @@ -43,0 +49 @@
   +[log.phase|phase:       draft]
-  @@ -50,0 +57 @@
   +[log.phase|phase:       draft]
-  @@ -58,0 +66 @@
   +[log.phase|phase:       draft]
-  @@ -66,0 +75 @@
   +[log.phase|phase:       draft]
-  @@ -77,0 +87 @@
   +[log.phase|phase:       draft]
 
   $ hg --color=debug -q log > log.out