comparison tests/test-commit-interactive-curses.t @ 43887:c06eba91c380

crecord: repurpose "a" key to toggle all selections (BC) I really don't like "a". I keep accidentally hitting it when I actually want "A", and then I'm suddenly in a state I don't want to be in. There's a big wall of text telling me that I've turned amend mode on or off (which one was I orginally in?), and this seems very useless. If I wanted to amend or not, I would have chosen that from the command-line, not change my mind after I've already started picking hunks apart. Furthermore, for most uses of the hunk selector (revert, uncommit, shelve/unshelve), this amend toggle doesn't make sense. It seems much better to repurpose this key to be a "weaker" version of "A". It toggles all selections. This is pretty harmless if hit accidentally, (can just hit "a" again to toggle everything and undo it), and has immediate visual feedback that something happened: all the x's and blank spaces get switched around. And unlike with amend, the current flipped state is also immediately visible without having to read a wall of text. I'm calling this a BC, however, because somewhere, someone out there has probably really fallen in love with the old use of "a" and will get angry that we took it away.
author Jordi Gutiérrez Hermoso <jordigh@octave.org>
date Tue, 10 Dec 2019 17:02:09 -0500
parents 9ac1a5a4a64f
children e5e6282fa66a
comparison
equal deleted inserted replaced
43886:fe0daceb51d0 43887:c06eba91c380
93 93
94 - Untoggle all the hunks, go down to the second file 94 - Untoggle all the hunks, go down to the second file
95 - unfold it 95 - unfold it
96 - go down to second hunk (1 for the first hunk, 1 for the first hunkline, 1 for the second hunk, 1 for the second hunklike) 96 - go down to second hunk (1 for the first hunk, 1 for the first hunkline, 1 for the second hunk, 1 for the second hunklike)
97 - toggle the second hunk 97 - toggle the second hunk
98 - toggle on and off the amend mode (to check that it toggles off) 98 - toggle all lines twice (to check that it does nothing)
99 - edit the hunk and quit the editor immediately with non-zero status 99 - edit the hunk and quit the editor immediately with non-zero status
100 - commit 100 - commit
101 101
102 $ printf "printf 'editor ran\n'; exit 1" > editor.sh 102 $ printf "printf 'editor ran\n'; exit 1" > editor.sh
103 $ echo "x" > c 103 $ echo "x" > c
191 ? testModeCommands 191 ? testModeCommands
192 $ hg commit -i -m "newly added file" -d "0 0" 192 $ hg commit -i -m "newly added file" -d "0 0"
193 $ hg st 193 $ hg st
194 ? testModeCommands 194 ? testModeCommands
195 195
196 Amend option works 196 Test toggling all selections works
197
198 - Change one line
199 - Add an extra line at the end
200 - Unselect all
201 - Select the extra line at the end
202 - Toggle all selections (so the extra line at the is unselected and the modified line is selected)
203 - Commit
204
197 $ echo "hello world" > x 205 $ echo "hello world" > x
198 $ hg diff -c . 206 $ echo "goodbye world" >> x
199 diff -r a6735021574d -r 2b0e9be4d336 x 207 $ hg diff
200 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 208 diff -r 2b0e9be4d336 x
209 --- a/x Thu Jan 01 00:00:00 1970 +0000
201 +++ b/x Thu Jan 01 00:00:00 1970 +0000 210 +++ b/x Thu Jan 01 00:00:00 1970 +0000
202 @@ -0,0 +1,1 @@ 211 @@ -1,1 +1,2 @@
203 +hello 212 -hello
204 $ cat <<EOF >testModeCommands 213 +hello world
214 +goodbye world
215 $ cat <<EOF >testModeCommands
216 > f
217 > j
218 > x
219 > j
220 > j
221 > j
222 > x
205 > a 223 > a
206 > c 224 > c
207 > EOF 225 > EOF
208 $ hg commit -i -m "newly added file" -d "0 0" 226 $ hg commit -i --amend -m "newly added file" -d "0 0" x
209 saved backup bundle to $TESTTMP/a/.hg/strip-backup/2b0e9be4d336-3cf0bc8c-amend.hg 227 saved backup bundle to $TESTTMP/a/.hg/strip-backup/2b0e9be4d336-3cf0bc8c-amend.hg
228 $ hg rev x --no-backup
210 $ hg diff -c . 229 $ hg diff -c .
211 diff -r a6735021574d -r c1d239d165ae x 230 diff -r a6735021574d -r c1d239d165ae x
212 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 231 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
213 +++ b/x Thu Jan 01 00:00:00 1970 +0000 232 +++ b/x Thu Jan 01 00:00:00 1970 +0000
214 @@ -0,0 +1,1 @@ 233 @@ -0,0 +1,1 @@