comparison mercurial/revlog.py @ 39767: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
comparison
equal deleted inserted replaced
39766:9358f5066811 39767:db088e133e91
112 112
113 # Store flag processors (cf. 'addflagprocessor()' to register) 113 # Store flag processors (cf. 'addflagprocessor()' to register)
114 _flagprocessors = { 114 _flagprocessors = {
115 REVIDX_ISCENSORED: None, 115 REVIDX_ISCENSORED: None,
116 } 116 }
117
118 # Flag processors for REVIDX_ELLIPSIS.
119 def ellipsisreadprocessor(rl, text):
120 return text, False
121
122 def ellipsiswriteprocessor(rl, text):
123 return text, False
124
125 def ellipsisrawprocessor(rl, text):
126 return False
127
128 ellipsisprocessor = (
129 ellipsisreadprocessor,
130 ellipsiswriteprocessor,
131 ellipsisrawprocessor,
132 )
117 133
118 _mdre = re.compile('\1\n') 134 _mdre = re.compile('\1\n')
119 def parsemeta(text): 135 def parsemeta(text):
120 """return (metadatadict, metadatasize)""" 136 """return (metadatadict, metadatasize)"""
121 # text can be buffer, so we can't use .startswith or .index 137 # text can be buffer, so we can't use .startswith or .index