[PATCH 2 of 5] record: use ui.curses() instead of checking the config directly

Laurent Charignon lcharignon at fb.com
Thu May 28 23:32:40 UTC 2015


# HG changeset patch
# User Laurent Charignon <lcharignon at fb.com>
# Date 1432850515 25200
#      Thu May 28 15:01:55 2015 -0700
# Node ID 529ed75f610870a50a9877491c8470065fc91805
# Parent  b912d229f4cdd20c0c8e4044b9b90cc9bc05c52c
record: use ui.curses() instead of checking the config directly

Before this patch we were checking the config flag direclty to know if the
curses ui was enabled. This has been abstracted in a function that we are using
in this patch.

diff --git a/mercurial/cmdutil.py b/mercurial/cmdutil.py
--- a/mercurial/cmdutil.py
+++ b/mercurial/cmdutil.py
@@ -59,11 +59,10 @@
         return patch.filterpatch(ui, originalhunks)
 
 def recordfilter(ui, originalhunks):
-    usecurses =  ui.configbool('experimental', 'crecord', False)
     testfile = ui.config('experimental', 'crecordtest', None)
     oldwrite = setupwrapcolorwrite(ui)
     try:
-        newchunks = filterchunks(ui, originalhunks, usecurses, testfile)
+        newchunks = filterchunks(ui, originalhunks, ui.curses(), testfile)
     finally:
         ui.write = oldwrite
     return newchunks



More information about the Mercurial-devel mailing list