diff mercurial/revlog.py @ 39783:db088e133e91

revlog: define ellipsis flag processors in core We will soon be teaching core to honor the ellipsis flag on revlogs. Moving the definition of the processor functions to core is the first step in this. The processor is still not registered unless the narrow extension is loaded. Differential Revision: https://phab.mercurial-scm.org/D4645
author Gregory Szorc <gregory.szorc@gmail.com>
date Wed, 05 Sep 2018 13:29:22 -0700
parents 5d343a24bff5
children 7b2b42fc377a
line wrap: on
line diff
--- a/mercurial/revlog.py	Wed Sep 05 12:44:25 2018 -0700
+++ b/mercurial/revlog.py	Wed Sep 05 13:29:22 2018 -0700
@@ -115,6 +115,22 @@
     REVIDX_ISCENSORED: None,
 }
 
+# Flag processors for REVIDX_ELLIPSIS.
+def ellipsisreadprocessor(rl, text):
+    return text, False
+
+def ellipsiswriteprocessor(rl, text):
+    return text, False
+
+def ellipsisrawprocessor(rl, text):
+    return False
+
+ellipsisprocessor = (
+    ellipsisreadprocessor,
+    ellipsiswriteprocessor,
+    ellipsisrawprocessor,
+)
+
 _mdre = re.compile('\1\n')
 def parsemeta(text):
     """return (metadatadict, metadatasize)"""