##// END OF EJS Templates
crecord: repurpose "a" key to toggle all selections (BC)...
Jordi Gutiérrez Hermoso -
r44339:c06eba91 default
parent child Browse files
Show More
@@ -990,6 +990,16 b' class curseschunkselector(object):'
990 self.toggleapply(item)
990 self.toggleapply(item)
991 self.waslasttoggleallapplied = not self.waslasttoggleallapplied
991 self.waslasttoggleallapplied = not self.waslasttoggleallapplied
992
992
993 def flipselections(self):
994 """
995 Flip all selections. Every selected line is unselected and vice
996 versa.
997 """
998 for header in self.headerlist:
999 for hunk in header.allchildren():
1000 for line in hunk.allchildren():
1001 self.toggleapply(line)
1002
993 def toggleallbetween(self):
1003 def toggleallbetween(self):
994 """toggle applied on or off for all items in range [lastapplied,
1004 """toggle applied on or off for all items in range [lastapplied,
995 current]. """
1005 current]. """
@@ -1638,7 +1648,7 b' smaller changesets. the following are va'
1638 ctrl-l : scroll the selected line to the top of the screen
1648 ctrl-l : scroll the selected line to the top of the screen
1639 m : edit / resume editing the commit message
1649 m : edit / resume editing the commit message
1640 e : edit the currently selected hunk
1650 e : edit the currently selected hunk
1641 a : toggle amend mode, only with commit -i
1651 a : toggle all selections
1642 c : confirm selected changes
1652 c : confirm selected changes
1643 r : review/edit and confirm selected changes
1653 r : review/edit and confirm selected changes
1644 q : quit without confirming (no changes will be made)
1654 q : quit without confirming (no changes will be made)
@@ -1914,7 +1924,7 b' are you sure you want to review/edit and'
1914 elif keypressed in ["q"]:
1924 elif keypressed in ["q"]:
1915 raise error.Abort(_(b'user quit'))
1925 raise error.Abort(_(b'user quit'))
1916 elif keypressed in ['a']:
1926 elif keypressed in ['a']:
1917 self.toggleamend(self.opts, test)
1927 self.flipselections()
1918 elif keypressed in ["c"]:
1928 elif keypressed in ["c"]:
1919 return True
1929 return True
1920 elif keypressed in ["r"]:
1930 elif keypressed in ["r"]:
@@ -95,7 +95,7 b' Committing only one hunk while aborting '
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
@@ -193,20 +193,39 b' Newly added files can be selected with t'
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
213 +hello world
214 +goodbye world
204 $ cat <<EOF >testModeCommands
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
General Comments 0
You need to be logged in to leave comments. Login now