Mercurial > hg
comparison tests/test-commit-interactive.t @ 41560:66399f2e92aa
commit: if interactive, look elsewhere for whitespace settings (BC)
Previously, when doing `commit -i`, we respected `diff.ignorews` and other
whitespace-related settings, which is probably unexpected. The primary reason
for this is to support hgext.record's commandline options, it's probably
accidental that the `[diff]` settings were also considered. See comments on
issue6042 and D5490. This can cause problems (issue5839, issue6042).
It is assumed by the author that the `[diff]` section is primarily for *viewing*
diffs, and that it is unlikely what people intend when attempting to commit or
revert.
With this change, if a user wants the behavior, they can clone their `[diff]`
settings to `commands.commit.interactive.<setting>`. This is thus a mild BC
change, but one I suspect is not going to be relied on by anyone.
Note: while doing a partial commit/revert, we do not know what command the user
is actually running. This means that the split extension, which ends up calling
into this code, will respect the `commands.commit.interactive.<setting>`
settings, and not a hypothetical `commands.split.interactive.<setting>`. This
*also* means that setting `commands.commit.interactive.ignoreblanklines`, for
example, will still cause issue5839. Considering the highly unlikely chance that
a user actually sets `commands.commit.interactive.<setting>`, the author deems
this risk acceptable.
Differential Revision: https://phab.mercurial-scm.org/D5834
author | Kyle Lippincott <spectral@google.com> |
---|---|
date | Thu, 31 Jan 2019 14:47:34 -0800 |
parents | 3a01ce246ece |
children | db72f9f6580e |
comparison
equal
deleted
inserted
replaced
41559:78b270a55dc6 | 41560:66399f2e92aa |
---|---|
1806 $ hg debugstate | grep ' subdir/f1$' | 1806 $ hg debugstate | grep ' subdir/f1$' |
1807 n 0 -1 unset subdir/f1 | 1807 n 0 -1 unset subdir/f1 |
1808 $ hg status -A subdir/f1 | 1808 $ hg status -A subdir/f1 |
1809 M subdir/f1 | 1809 M subdir/f1 |
1810 | 1810 |
1811 Test diff.unified=0 | 1811 Test commands.commit.interactive.unified=0 |
1812 | 1812 |
1813 $ hg init $TESTTMP/b | 1813 $ hg init $TESTTMP/b |
1814 $ cd $TESTTMP/b | 1814 $ cd $TESTTMP/b |
1815 $ cat > foo <<EOF | 1815 $ cat > foo <<EOF |
1816 > 1 | 1816 > 1 |
1827 > 3 | 1827 > 3 |
1828 > change2 | 1828 > change2 |
1829 > 4 | 1829 > 4 |
1830 > 5 | 1830 > 5 |
1831 > EOF | 1831 > EOF |
1832 $ printf 'y\ny\ny\n' | hg ci -im initial --config diff.unified=0 | 1832 $ printf 'y\ny\ny\n' | hg ci -im initial --config commands.commit.interactive.unified=0 |
1833 diff --git a/foo b/foo | 1833 diff --git a/foo b/foo |
1834 2 hunks, 2 lines changed | 1834 2 hunks, 2 lines changed |
1835 examine changes to 'foo'? [Ynesfdaq?] y | 1835 examine changes to 'foo'? [Ynesfdaq?] y |
1836 | 1836 |
1837 @@ -1,0 +2,1 @@ 1 | 1837 @@ -1,0 +2,1 @@ 1 |