From patchwork Wed Dec 16 18:46:26 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [4,of,5,stable,V2] cmdutil: use crecordmod.checkcurses From: Sean Farley X-Patchwork-Id: 12078 Message-Id: To: mercurial-devel@selenic.com Date: Wed, 16 Dec 2015 10:46:26 -0800 # HG changeset patch # User Sean Farley # 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)