[PATCH 5 of 6 stable] mq: don't lose whitespace changes with [diff] ignorewsamount=True

Mads Kiilerich mads at kiilerich.com
Sat Jun 17 17:06:21 EDT 2017


# HG changeset patch
# User Mads Kiilerich <mads at kiilerich.com>
# Date 1497727704 -7200
#      Sat Jun 17 21:28:24 2017 +0200
# Branch stable
# Node ID feb176a4bd5186488abb27ed9ed4d5fcd9df6f12
# Parent  5dfc12c8d1fa53baf7b9d0099bbac1e05b90f75f
mq: don't lose whitespace changes with [diff] ignorewsamount=True

Patches are fragile - missing whitespace can make them fail to apply correctly.

diff --git a/hgext/mq.py b/hgext/mq.py
--- a/hgext/mq.py
+++ b/hgext/mq.py
@@ -521,6 +521,7 @@ class queue(object):
             diffopts.nobinary = False
             diffopts.noprefix = False
             diffopts.ignorews = False
+            diffopts.ignorewsamount = False
             # note: diff options showfunc and unified might influence diffs
             # but don't do any harm
         return diffopts
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
@@ -246,6 +246,12 @@ Test how [diff] configuration influence 
   # Date 0 0
   # Parent  fb9c4422b0f37dd576522dd9a3f99b825c177efe
   
+  diff --git a/a b/a
+  --- a/a
+  +++ b/a
+  @@ -1,1 +1,1 @@
+  - a
+  +  a
   diff --git a/b b/b
   index 78981922613b2afb6025042ff6bd878ac1994e85..f76dd238ade08917e6712764a16a22005a50573d
   GIT binary patch


More information about the Mercurial-devel mailing list