##// END OF EJS Templates
flagutil: move the `flagprocessors` mapping in the new module...
marmoute -
r42955:05c80f9e default
parent child Browse files
Show More
@@ -72,6 +72,7 b' from . import ('
72 72 )
73 73 from .revlogutils import (
74 74 deltas as deltautil,
75 flagutil,
75 76 )
76 77 from .utils import (
77 78 interfaceutil,
@@ -110,11 +111,6 b" rustdagop = policy.importrust(r'dagop')"
110 111 _maxinline = 131072
111 112 _chunksize = 1048576
112 113
113 # Store flag processors (cf. 'addflagprocessor()' to register)
114 _flagprocessors = {
115 REVIDX_ISCENSORED: None,
116 }
117
118 114 # Flag processors for REVIDX_ELLIPSIS.
119 115 def ellipsisreadprocessor(rl, text):
120 116 return text, False
@@ -156,7 +152,7 b' def addflagprocessor(flag, processor):'
156 152 debug commands. In this case the transform only indicates whether the
157 153 contents can be used for hash integrity checks.
158 154 """
159 _insertflagprocessor(flag, processor, _flagprocessors)
155 _insertflagprocessor(flag, processor, flagutil.flagprocessors)
160 156
161 157 def _insertflagprocessor(flag, processor, flagprocessors):
162 158 if not flag & REVIDX_KNOWN_FLAGS:
@@ -386,7 +382,7 b' class revlog(object):'
386 382
387 383 # Make copy of flag processors so each revlog instance can support
388 384 # custom flags.
389 self._flagprocessors = dict(_flagprocessors)
385 self._flagprocessors = dict(flagutil.flagprocessors)
390 386
391 387 # 2-tuple of file handles being used for active writing.
392 388 self._writinghandles = None
@@ -28,4 +28,8 b' REVIDX_FLAGS_ORDER'
28 28 REVIDX_KNOWN_FLAGS
29 29 REVIDX_RAWTEXT_CHANGING_FLAGS
30 30
31 # Store flag processors (cf. 'addflagprocessor()' to register)
32 flagprocessors = {
33 REVIDX_ISCENSORED: None,
34 }
31 35
@@ -206,7 +206,7 b' Ensure the data got to the server OK'
206 206 File "*/tests/flagprocessorext.py", line *, in extsetup (glob)
207 207 validatehash,
208 208 File "*/mercurial/revlog.py", line *, in addflagprocessor (glob)
209 _insertflagprocessor(flag, processor, _flagprocessors)
209 _insertflagprocessor(flag, processor, flagutil.flagprocessors)
210 210 File "*/mercurial/revlog.py", line *, in _insertflagprocessor (glob)
211 211 raise error.Abort(msg)
212 212 mercurial.error.Abort: b"cannot register multiple processors on flag '0x8'." (py3 !)
General Comments 0
You need to be logged in to leave comments. Login now