diff tests/test-commit-interactive.t @ 41557:3a01ce246ece

commit: ignore diff whitespace settings when doing `commit -i` (issue5839) Previously, we respected options like `diff.ignoreblanklines` and `diff.ignorews`. This can cause problems when the user is attempting to actually commit the blank line change. Specifically, the split extension can get into an infinite loop because it detects that the working copy is not clean, but when we get the diff we don't see the changes, so it just skips popping up the chunk selection flow, saying there's no changes to record. These options are primarily meant for viewing diffs; it is highly unlikely that someone is actually intending to add extraneous whitespace and have it ignored if they attempt to interactively commit (but *not* ignored if they non-interactively commit). Differential Revision: https://phab.mercurial-scm.org/D5744
author Kyle Lippincott <spectral@google.com>
date Mon, 28 Jan 2019 18:05:05 -0800
parents d1d3094b54f9
children 66399f2e92aa
line wrap: on
line diff
--- a/tests/test-commit-interactive.t	Mon Feb 04 14:43:26 2019 -0800
+++ b/tests/test-commit-interactive.t	Mon Jan 28 18:05:05 2019 -0800
@@ -1842,3 +1842,47 @@
   +change2
   record change 2/2 to 'foo'? [Ynesfdaq?] y
   
+  $ cd $TESTTMP
+
+Test diff.ignoreblanklines=1
+
+  $ hg init c
+  $ cd c
+  $ cat > foo <<EOF
+  > 1
+  > 2
+  > 3
+  > 4
+  > 5
+  > EOF
+  $ hg ci -qAm initial
+  $ cat > foo <<EOF
+  > 1
+  > 
+  > 2
+  > 3
+  > change2
+  > 4
+  > 5
+  > EOF
+  $ printf 'y\ny\ny\n' | hg ci -im initial --config diff.ignoreblanklines=1
+  diff --git a/foo b/foo
+  2 hunks, 2 lines changed
+  examine changes to 'foo'? [Ynesfdaq?] y
+  
+  @@ -1,3 +1,4 @@
+   1
+  +
+   2
+   3
+  record change 1/2 to 'foo'? [Ynesfdaq?] y
+  
+  @@ -2,4 +3,5 @@
+   2
+   3
+  +change2
+   4
+   5
+  record change 2/2 to 'foo'? [Ynesfdaq?] y
+  
+