crecord: change help text for the space key dynamically
authorJun Wu <quark@fb.com>
Mon, 28 Nov 2016 23:37:29 +0000
changeset 30556 5129ed3c2548
parent 30555 9b674957e2e4
child 30557 8d9745ff1e62
crecord: change help text for the space key dynamically A follow-up of the previous patch, to make the text simple and clear about whether it's to "select" or "deselect".
mercurial/crecord.py
--- a/mercurial/crecord.py	Mon Nov 28 23:33:02 2016 +0000
+++ b/mercurial/crecord.py	Mon Nov 28 23:37:29 2016 +0000
@@ -948,6 +948,7 @@
 
     def _getstatuslinesegments(self):
         """-> [str]. return segments"""
+        selected = self.currentselecteditem.applied
         segments = [
             _('Select hunks to record'),
             '-',
@@ -955,7 +956,7 @@
             _('c: confirm'),
             _('q: abort'),
             _('arrow keys: move/expand/collapse'),
-            _('space: select'),
+            _('space: deselect') if selected else _('space: select'),
             _('?: help'),
         ]
         return segments