[PATCH 4 of 5 stable] cmdutil: use crecordmod.checkcurses
Sean Farley
sean at farley.io
Tue Dec 15 18:06:15 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 23202dc041db998d6e2529b80dd4e7e4d4b4b040
# Parent bd8254a6cc25a040fc70d10a7e1d06935865280f
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