Patchwork [1,of,2,stable] mq: test coverage of how [diff] configuration influence can break mq patches

login
register
mail settings
Submitter Mads Kiilerich
Date Sept. 10, 2017, 10:43 p.m.
Message ID <e05e50fbdeaf7eb52a29.1505083407@xps>
Download mbox | patch
Permalink /patch/23748/
State Accepted
Headers show

Comments

Mads Kiilerich - Sept. 10, 2017, 10:43 p.m.
# HG changeset patch
# User Mads Kiilerich <mads@kiilerich.com>
# Date 1505083342 -7200
#      Mon Sep 11 00:42:22 2017 +0200
# Branch stable
# Node ID e05e50fbdeaf7eb52a2936e1dfe98643d68c334e
# Parent  3c3066367d72344935aabf9606a5b40e9950b5e7
mq: test coverage of how [diff] configuration influence can break mq patches
Yuya Nishihara - Sept. 11, 2017, 1:24 p.m.
On Mon, 11 Sep 2017 00:43:27 +0200, Mads Kiilerich wrote:
> # HG changeset patch
> # User Mads Kiilerich <mads@kiilerich.com>
> # Date 1505083342 -7200
> #      Mon Sep 11 00:42:22 2017 +0200
> # Branch stable
> # Node ID e05e50fbdeaf7eb52a2936e1dfe98643d68c334e
> # Parent  3c3066367d72344935aabf9606a5b40e9950b5e7
> mq: test coverage of how [diff] configuration influence can break mq patches

Queued, thanks.

Patch

diff --git a/tests/test-mq-git.t b/tests/test-mq-git.t
--- a/tests/test-mq-git.t
+++ b/tests/test-mq-git.t
@@ -208,5 +208,40 @@  git=no: regular patch after qrefresh wit
   @@ -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 ..