Patchwork record: add message when starting record's curses interface

login
register
mail settings
Submitter Laurent Charignon
Date April 16, 2015, 9:33 p.m.
Message ID <e8f90dace3cf526cb543.1429219988@dev919.prn2.facebook.com>
Download mbox | patch
Permalink /patch/8728/
State Accepted
Headers show

Comments

Laurent Charignon - April 16, 2015, 9:33 p.m.
# HG changeset patch
# User Laurent Charignon <lcharignon@fb.com>
# Date 1429219610 25200
#      Thu Apr 16 14:26:50 2015 -0700
# Node ID e8f90dace3cf526cb5434190a4e048192908c30d
# Parent  c560d8c687916cb70a6d54c2c9ddcb5c9e457be2
record: add message when starting record's curses interface

We are adding this log message to reduce a confusion when a command prints
something just before starting the curses interface.

Since the interactive mode is taking over the entire screen, starts with no
delay and does wait for a key press, the user believes that messages printed
before opening the interactive mode were actually printed after using
interactive mode, not before.
The fix adds the line "Starting interactive mode" helping the user separate
the messages that were printed before and after the start of the
interactive mode.

One particular example where this was a problem is the revert command where we
first print the list of changes to be considered for revert, then opens the
curses interface right away without letting the user see the messages.
The user then selects the changes, validates and then see the messages from
before opening the interactive mode and is confused.
Matt Mackall - April 16, 2015, 10:50 p.m.
On Thu, 2015-04-16 at 14:33 -0700, Laurent Charignon wrote:
> # HG changeset patch
> # User Laurent Charignon <lcharignon@fb.com>
> # Date 1429219610 25200
> #      Thu Apr 16 14:26:50 2015 -0700
> # Node ID e8f90dace3cf526cb5434190a4e048192908c30d
> # Parent  c560d8c687916cb70a6d54c2c9ddcb5c9e457be2
> record: add message when starting record's curses interface

Sure, queued for default.

Patch

diff --git a/mercurial/crecord.py b/mercurial/crecord.py
--- a/mercurial/crecord.py
+++ b/mercurial/crecord.py
@@ -477,6 +477,7 @@ 
     of the chosen chunks.
 
     """
+    ui.write(_('starting interactive selection\n'))
     chunkselector = curseschunkselector(headerlist, ui)
     curses.wrapper(chunkselector.main)