Patchwork [7,of,8] crecord: change help text for the space key dynamically

login
register
mail settings
Submitter Jun Wu
Date Nov. 23, 2016, 11:24 p.m.
Message ID <18b6dea42fcdf5922926.1479943482@x1c>
Download mbox | patch
Permalink /patch/17739/
State Accepted
Headers show

Comments

Jun Wu - Nov. 23, 2016, 11:24 p.m.
# HG changeset patch
# User Jun Wu <quark@fb.com>
# Date 1479941166 0
#      Wed Nov 23 22:46:06 2016 +0000
# Node ID 18b6dea42fcdf5922926d6a0ab84f09c0cf5bd1a
# Parent  9e7850a8ae79f7ccf1855a489d42d66dc1d949db
# Available At https://bitbucket.org/quark-zju/hg-draft
#              hg pull https://bitbucket.org/quark-zju/hg-draft -r 18b6dea42fcd
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 "unselect".
timeless - Nov. 24, 2016, 2:20 a.m.
Jun Wu wrote:
> +            _('space: unselect') if selected else _('space: select'),

I favor deselect (13million) over unselect (2.5million) -- numbers from Google.

Patch

diff --git a/mercurial/crecord.py b/mercurial/crecord.py
--- a/mercurial/crecord.py
+++ b/mercurial/crecord.py
@@ -949,4 +949,5 @@  class curseschunkselector(object):
     def _getstatuslinesegments(self):
         """-> [str]. return segments"""
+        selected = self.currentselecteditem.applied
         segments = [
             _('Select hunks to record.'),
@@ -955,5 +956,5 @@  class curseschunkselector(object):
             _('q: abort'),
             _('arrow keys: move/expand/collapse'),
-            _('space: select'),
+            _('space: unselect') if selected else _('space: select'),
             _('?: help'),
         ]