changeset 34089:e05e50fbdeaf stable

mq: test coverage of how [diff] configuration influence can break mq patches
author Mads Kiilerich <mads@kiilerich.com>
date Mon, 11 Sep 2017 00:42:22 +0200
parents 3c3066367d72
children 987a85c42b08
files tests/test-mq-git.t
diffstat 1 files changed, 35 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/tests/test-mq-git.t	Tue Aug 29 16:38:10 2017 -0400
+++ b/tests/test-mq-git.t	Mon Sep 11 00:42:22 2017 +0200
@@ -208,5 +208,40 @@
   @@ -0,0 +1,1 @@
   +a
 
+Test how [diff] configuration influence and cause invalid or lossy patches:
+
+  $ cat <<EOF >> .hg/hgrc
+  > [mq]
+  > git = AUTO
+  > [diff]
+  > nobinary = True
+  > noprefix = True
+  > showfunc = True
+  > ignorews = True
+  > ignorewsamount = True
+  > ignoreblanklines = True
+  > unified = 1
+  > EOF
+
+  $ echo ' a' > a
+  $ hg qnew prepare -d '0 0'
+  $ echo '  a' > a
+  $ printf '\0' > b
+  $ echo >> c
+  $ hg qnew diff -d '0 0'
+
+  $ cat .hg/patches/prepare
+  # HG changeset patch
+  # Date 0 0
+  # Parent  cf0bfe72686a47d8d7d7b4529a3adb8b0b449a9f
+  
+  $ cat .hg/patches/diff
+  # HG changeset patch
+  # Date 0 0
+  # Parent  fb9c4422b0f37dd576522dd9a3f99b825c177efe
+  
+  diff --git b b
+  Binary file b has changed
+
   $ cd ..