Patchwork [STABLE] solaris: diff -u emits "No differences encountered"

login
register
mail settings
Submitter Danek Duvall
Date Feb. 19, 2014, 11:42 p.m.
Message ID <921bee7c9985df6c0231.1392853340@smelly>
Download mbox | patch
Permalink /patch/3704/
State Accepted
Commit e57e2da803aa497788e3baab7479e3d1a838a7f2
Headers show

Comments

Danek Duvall - Feb. 19, 2014, 11:42 p.m.
# HG changeset patch
# User Danek Duvall <danek.duvall@oracle.com>
# Date 1392846409 28800
#      Wed Feb 19 13:46:49 2014 -0800
# Node ID 921bee7c9985df6c023106dd74e4d32ee8020d20
# Parent  0e2877f8605dcaf4fdf2ab7e0046f1f6f80161dd
solaris: diff -u emits "No differences encountered"

Solaris diff -u isn't silent when two files are identical, and tests that
don't account for that will fail.  Fix those tests, and introduce a check
that prevents reintroduction.
Augie Fackler - Feb. 28, 2014, 7:47 p.m.
On Feb 19, 2014, at 6:42 PM, Danek Duvall <danek.duvall@oracle.com> wrote:

> # HG changeset patch
> # User Danek Duvall <danek.duvall@oracle.com>
> # Date 1392846409 28800
> #      Wed Feb 19 13:46:49 2014 -0800
> # Node ID 921bee7c9985df6c023106dd74e4d32ee8020d20
> # Parent  0e2877f8605dcaf4fdf2ab7e0046f1f6f80161dd
> solaris: diff -u emits "No differences encountered"

queued, thanks.

yay solaris.

> 
> Solaris diff -u isn't silent when two files are identical, and tests that
> don't account for that will fail.  Fix those tests, and introduce a check
> that prevents reintroduction.
> 
> diff --git a/contrib/check-code.py b/contrib/check-code.py
> --- a/contrib/check-code.py
> +++ b/contrib/check-code.py
> @@ -121,6 +121,7 @@ testpats = [
>    (r'^( *)\t', "don't use tabs to indent"),
>    (r'sed (-e )?\'(\d+|/[^/]*/)i(?!\\\n)',
>     "put a backslash-escaped newline after sed 'i' command"),
> +    (r'^diff *-\w*u.*$\n(^  \$ |^$)', "prefix diff -u with cmp"),
>  ],
>  # warnings
>  [
> diff --git a/tests/test-convert-bzr.t b/tests/test-convert-bzr.t
> --- a/tests/test-convert-bzr.t
> +++ b/tests/test-convert-bzr.t
> @@ -102,7 +102,7 @@ compare timestamps
>>> ../bzr-timestamps
>  $ cd ..
>  $ hg -R source-hg log --template "{date|isodate}\n" > hg-timestamps
> -  $ diff -u bzr-timestamps hg-timestamps
> +  $ cmp bzr-timestamps hg-timestamps || diff -u bzr-timestamps hg-timestamps
>  $ cd ..
> 
> merge
> diff --git a/tests/test-highlight.t b/tests/test-highlight.t
> --- a/tests/test-highlight.t
> +++ b/tests/test-highlight.t
> @@ -522,7 +522,7 @@ hgweb fileannotate, raw
>  $ echo "" >> b
>  $ echo "" >> b
>  $ echo "" >> b
> -  $ diff -u b a
> +  $ cmp b a || diff -u b a
> 
> hgweb filerevision, raw
> 
> @@ -531,7 +531,7 @@ hgweb filerevision, raw
>  $ echo "200 Script output follows" > b
>  $ echo "" >> b
>  $ hg cat primes.py >> b
> -  $ diff -u b a
> +  $ cmp b a || diff -u b a
> 
> hgweb highlightcss friendly
> 
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel@selenic.com
> http://selenic.com/mailman/listinfo/mercurial-devel

Patch

diff --git a/contrib/check-code.py b/contrib/check-code.py
--- a/contrib/check-code.py
+++ b/contrib/check-code.py
@@ -121,6 +121,7 @@  testpats = [
     (r'^( *)\t', "don't use tabs to indent"),
     (r'sed (-e )?\'(\d+|/[^/]*/)i(?!\\\n)',
      "put a backslash-escaped newline after sed 'i' command"),
+    (r'^diff *-\w*u.*$\n(^  \$ |^$)', "prefix diff -u with cmp"),
   ],
   # warnings
   [
diff --git a/tests/test-convert-bzr.t b/tests/test-convert-bzr.t
--- a/tests/test-convert-bzr.t
+++ b/tests/test-convert-bzr.t
@@ -102,7 +102,7 @@  compare timestamps
   >   > ../bzr-timestamps
   $ cd ..
   $ hg -R source-hg log --template "{date|isodate}\n" > hg-timestamps
-  $ diff -u bzr-timestamps hg-timestamps
+  $ cmp bzr-timestamps hg-timestamps || diff -u bzr-timestamps hg-timestamps
   $ cd ..
 
 merge
diff --git a/tests/test-highlight.t b/tests/test-highlight.t
--- a/tests/test-highlight.t
+++ b/tests/test-highlight.t
@@ -522,7 +522,7 @@  hgweb fileannotate, raw
   $ echo "" >> b
   $ echo "" >> b
   $ echo "" >> b
-  $ diff -u b a
+  $ cmp b a || diff -u b a
 
 hgweb filerevision, raw
 
@@ -531,7 +531,7 @@  hgweb filerevision, raw
   $ echo "200 Script output follows" > b
   $ echo "" >> b
   $ hg cat primes.py >> b
-  $ diff -u b a
+  $ cmp b a || diff -u b a
 
 hgweb highlightcss friendly