Patchwork [3,of,6] record: enable curses recording logic with experimental flag

login
register
mail settings
Submitter Laurent Charignon
Date March 13, 2015, 9:21 p.m.
Message ID <0c3a80879d4ede76101b.1426281714@dev919.prn2.facebook.com>
Download mbox | patch
Permalink /patch/8070/
State Accepted
Headers show

Comments

Laurent Charignon - March 13, 2015, 9:21 p.m.
# HG changeset patch
# User Laurent Charignon <lcharignon@fb.com>
# Date 1426195488 25200
#      Thu Mar 12 14:24:48 2015 -0700
# Node ID 0c3a80879d4ede76101bbe46d4a67a19a6e28608
# Parent  e7f74755e91ddaa44e7a8aa2ff61204ebcb12418
record: enable curses recording logic with experimental flag

Patch

diff --git a/mercurial/cmdutil.py b/mercurial/cmdutil.py
--- a/mercurial/cmdutil.py
+++ b/mercurial/cmdutil.py
@@ -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)
+    curses_record =  ui.configbool('experimental', 'crecord', False)
+    if curses_record:
+        testmode_fn = ui.config('experimental', 'crecordTestMode', None)
+        if testmode_fn:
+            recordfn = crecordmod.testdecorator(testmode_fn,
+                                                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):