Patchwork [4,of,7] tests: explicitly require binary diffs generation in Git mode

login
register
mail settings
Submitter Alexander Fomin
Date March 21, 2017, 5:08 p.m.
Message ID <b1eb6801f90a45ef43f1.1490116117@devvm2125.lla2.facebook.com>
Download mbox | patch
Permalink /patch/19530/
State Changes Requested
Headers show

Comments

Alexander Fomin - March 21, 2017, 5:08 p.m.
# HG changeset patch
# User Alexander Fomin <afomin@fb.com>
# Date 1490105477 25200
#      Tue Mar 21 07:11:17 2017 -0700
# Node ID b1eb6801f90a45ef43f17a22d9835ccba4ac190b
# Parent  a4b6c5df3e64195cb8ba124d9dd2428483cfc6a6
tests: explicitly require binary diffs generation in Git mode

This patch makes existing tests explicitly request binary diffs generation by
using -a option even in Git mode.
It has no immediate effect, but rather allows to change hg behaviour with
regarding to binary diffs generation in Git mode (issue5510).

Patch

diff --git a/tests/test-diff-binary-file.t b/tests/test-diff-binary-file.t
--- a/tests/test-diff-binary-file.t
+++ b/tests/test-diff-binary-file.t
@@ -19,7 +19,7 @@ 
 
   $ hg diff --nodates -r 0 -r 2
 
-  $ hg diff --git -r 0 -r 1
+  $ hg diff --git -a -r 0 -r 1
   diff --git a/binfile.bin b/binfile.bin
   index 37ba3d1c6f17137d9c5f5776fa040caf5fe73ff9..58dc31a9e2f40f74ff3b45903f7d620b8e5b7356
   GIT binary patch
@@ -44,7 +44,7 @@ 
   diff --git a/binfile.bin b/binfile.bin
   Binary file binfile.bin has changed
 
-  $ HGPLAIN=1 hg diff --config diff.nobinary=True --git -r 0 -r 1
+  $ HGPLAIN=1 hg diff --config diff.nobinary=True --git -a -r 0 -r 1
   diff --git a/binfile.bin b/binfile.bin
   index 37ba3d1c6f17137d9c5f5776fa040caf5fe73ff9..58dc31a9e2f40f74ff3b45903f7d620b8e5b7356
   GIT binary patch
@@ -64,7 +64,7 @@ 
   
 
 
-  $ hg diff --git -r 2 -r 3
+  $ hg diff --git -a -r 2 -r 3
   diff --git a/binfile.bin b/nonbinfile
   copy from binfile.bin
   copy to nonbinfile
diff --git a/tests/test-git-export.t b/tests/test-git-export.t
--- a/tests/test-git-export.t
+++ b/tests/test-git-export.t
@@ -342,7 +342,7 @@  Binary diff:
 
   $ cp "$TESTDIR/binfile.bin" .
   $ hg add binfile.bin
-  $ hg diff --git > b.diff
+  $ hg diff --git -a > b.diff
   $ cat b.diff
   diff --git a/binfile.bin b/binfile.bin
   new file mode 100644
diff --git a/tests/test-import-eol.t b/tests/test-import-eol.t
--- a/tests/test-import-eol.t
+++ b/tests/test-import-eol.t
@@ -131,7 +131,7 @@  Test --eol and binary patches
   $ hg ci -Am addb
   adding b
   $ $PYTHON -c 'file("b", "wb").write("a\x00\nc\r\nd")'
-  $ hg diff --git > bin.diff
+  $ hg diff --git -a > bin.diff
   $ hg revert --no-backup b
 
 binary patch with --eol