[PATCH 4 of 5 stable V2] cmdutil: use crecordmod.checkcurses

Sean Farley sean at farley.io
Wed Dec 16 12:46:26 CST 2015


# HG changeset patch
# User Sean Farley <sean at farley.io>
# Date 1450224105 28800
#      Tue Dec 15 16:01:45 2015 -0800
# Branch stable
# Node ID dc4c30b212b79a63a43930ef6547e4165fb810e3
# Parent  11971d769204eb9b53bc37c75b569444bc5cd016
cmdutil: use crecordmod.checkcurses

Instead of blindly trusting the user's experimental.crecord, we use checkcurses
to abstract that logic so that we can handle the case where python was not
built with curses.

diff --git a/mercurial/cmdutil.py b/mercurial/cmdutil.py
--- a/mercurial/cmdutil.py
+++ b/mercurial/cmdutil.py
@@ -64,11 +64,11 @@ def recordfilter(ui, originalhunks, oper
     selected hunks.
     *operation* is used for ui purposes to indicate the user
     what kind of filtering they are doing: reverting, committing, shelving, etc.
     *operation* has to be a translated string.
     """
-    usecurses =  ui.configbool('experimental', 'crecord', False)
+    usecurses = crecordmod.checkcurses(ui)
     testfile = ui.config('experimental', 'crecordtest', None)
     oldwrite = setupwrapcolorwrite(ui)
     try:
         newchunks = filterchunks(ui, originalhunks, usecurses, testfile,
                                  operation)


More information about the Mercurial-devel mailing list