changeset 24343:69538481ea9f

record: enable curses recording logic with experimental flag
author Laurent Charignon <lcharignon@fb.com>
date Thu, 12 Mar 2015 14:24:48 -0700
parents be3ab98f11e0
children 6b43baac6dfb
files mercurial/cmdutil.py
diffstat 1 files changed, 14 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/cmdutil.py	Fri Mar 13 10:51:25 2015 -0700
+++ b/mercurial/cmdutil.py	Thu Mar 12 14:24:48 2015 -0700
@@ -16,12 +16,25 @@
 import encoding
 import crecord as crecordmod
 import lock as lockmod
+import crecord as crecordmod
 
 def parsealiases(cmd):
     return cmd.lstrip("^").split("|")
 
 def recordfilter(ui, originalhunks):
-    return patch.filterpatch(ui, originalhunks)
+    usecurses =  ui.configbool('experimental', 'crecord', False)
+    if usecurses:
+        testfile = ui.config('experimental', 'crecordtest', None)
+        if testfile:
+            recordfn = crecordmod.testdecorator(testfile,
+                                                crecordmod.testchunkselector)
+        else:
+            recordfn = crecordmod.chunkselector
+
+        return crecordmod.filterpatch(ui, originalhunks, recordfn)
+
+    else:
+        return patch.filterpatch(ui, originalhunks)
 
 def dorecord(ui, repo, commitfunc, cmdsuggest, backupall,
             filterfn, *pats, **opts):