D6618: crecord: add "x" alias for space, remove test-only "TOGGLE" alias

spectral (Kyle Lippincott) phabricator at mercurial-scm.org
Mon Jul 8 16:29:03 EDT 2019


spectral created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D6618

AFFECTED FILES
  mercurial/crecord.py
  tests/test-commit-interactive-curses.t

CHANGE DETAILS

diff --git a/tests/test-commit-interactive-curses.t b/tests/test-commit-interactive-curses.t
--- a/tests/test-commit-interactive-curses.t
+++ b/tests/test-commit-interactive-curses.t
@@ -34,7 +34,7 @@
   $ echo "a" > a
   $ hg add a
   $ cat <<EOF >testModeCommands
-  > TOGGLE
+  > x
   > c
   > EOF
   $ hg commit -i  -m "a" -d "0 0"
@@ -71,7 +71,7 @@
   >>> open('b', 'wb').write(b"1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n") and None
   $ hg add b
   $ cat <<EOF >testModeCommands
-  > TOGGLE
+  > x
   > KEY_DOWN
   > c
   > EOF
@@ -112,7 +112,7 @@
   > KEY_DOWN
   > KEY_DOWN
   > KEY_DOWN
-  > TOGGLE
+  > x
   > a
   > a
   > e
@@ -182,8 +182,8 @@
   $ echo "hello" > x
   $ hg add x
   $ cat <<EOF >testModeCommands
-  > TOGGLE
-  > TOGGLE
+  > x
+  > x
   > c
   > EOF
   $ hg st
@@ -240,7 +240,7 @@
   > KEY_DOWN
   > KEY_DOWN
   > e
-  > TOGGLE
+  > x
   > c
   > EOF
   $ printf "printf 'editor ran\n'; exit 0" > editor.sh
@@ -272,11 +272,11 @@
   > EOF
   $ cat > testModeCommands <<EOF
   > KEY_DOWN
-  > TOGGLE
+  > x
   > KEY_DOWN
   > f
   > KEY_DOWN
-  > TOGGLE
+  > x
   > R
   > EOF
 
diff --git a/mercurial/crecord.py b/mercurial/crecord.py
--- a/mercurial/crecord.py
+++ b/mercurial/crecord.py
@@ -1460,7 +1460,7 @@
 can use crecord multiple times to split large changes into smaller changesets.
 the following are valid keystrokes:
 
-                [space] : (un-)select item ([~]/[x] = partly/fully applied)
+              x [space] : (un-)select item ([~]/[x] = partly/fully applied)
                 [enter] : (un-)select item and go to next item of same type
                       A : (un-)select all items
     up/down-arrow [k/j] : go to previous/next unfolded item
@@ -1749,7 +1749,7 @@
         elif test and keypressed in ['R']:
             self.opts['review'] = True
             return True
-        elif keypressed in [' '] or (test and keypressed in ["TOGGLE"]):
+        elif keypressed in [' ', 'x']:
             self.toggleapply()
         elif keypressed in ['\n', 'KEY_ENTER']:
             self.toggleapply()



To: spectral, #hg-reviewers
Cc: mercurial-devel


More information about the Mercurial-devel mailing list