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

Jun Wu quark at fb.com
Wed Nov 23 18:24:42 EST 2016


# HG changeset patch
# User Jun Wu <quark at 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".

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'),
         ]


More information about the Mercurial-devel mailing list