##// 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 from .revlogutils import (
73 from .revlogutils import (
74 deltas as deltautil,
74 deltas as deltautil,
75 flagutil,
75 )
76 )
76 from .utils import (
77 from .utils import (
77 interfaceutil,
78 interfaceutil,
@@ -110,11 +111,6 b" rustdagop = policy.importrust(r'dagop')"
110 _maxinline = 131072
111 _maxinline = 131072
111 _chunksize = 1048576
112 _chunksize = 1048576
112
113
113 # Store flag processors (cf. 'addflagprocessor()' to register)
114 _flagprocessors = {
115 REVIDX_ISCENSORED: None,
116 }
117
118 # Flag processors for REVIDX_ELLIPSIS.
114 # Flag processors for REVIDX_ELLIPSIS.
119 def ellipsisreadprocessor(rl, text):
115 def ellipsisreadprocessor(rl, text):
120 return text, False
116 return text, False
@@ -156,7 +152,7 b' def addflagprocessor(flag, processor):'
156 debug commands. In this case the transform only indicates whether the
152 debug commands. In this case the transform only indicates whether the
157 contents can be used for hash integrity checks.
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 def _insertflagprocessor(flag, processor, flagprocessors):
157 def _insertflagprocessor(flag, processor, flagprocessors):
162 if not flag & REVIDX_KNOWN_FLAGS:
158 if not flag & REVIDX_KNOWN_FLAGS:
@@ -386,7 +382,7 b' class revlog(object):'
386
382
387 # Make copy of flag processors so each revlog instance can support
383 # Make copy of flag processors so each revlog instance can support
388 # custom flags.
384 # custom flags.
389 self._flagprocessors = dict(_flagprocessors)
385 self._flagprocessors = dict(flagutil.flagprocessors)
390
386
391 # 2-tuple of file handles being used for active writing.
387 # 2-tuple of file handles being used for active writing.
392 self._writinghandles = None
388 self._writinghandles = None
@@ -28,4 +28,8 b' REVIDX_FLAGS_ORDER'
28 REVIDX_KNOWN_FLAGS
28 REVIDX_KNOWN_FLAGS
29 REVIDX_RAWTEXT_CHANGING_FLAGS
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 File "*/tests/flagprocessorext.py", line *, in extsetup (glob)
206 File "*/tests/flagprocessorext.py", line *, in extsetup (glob)
207 validatehash,
207 validatehash,
208 File "*/mercurial/revlog.py", line *, in addflagprocessor (glob)
208 File "*/mercurial/revlog.py", line *, in addflagprocessor (glob)
209 _insertflagprocessor(flag, processor, _flagprocessors)
209 _insertflagprocessor(flag, processor, flagutil.flagprocessors)
210 File "*/mercurial/revlog.py", line *, in _insertflagprocessor (glob)
210 File "*/mercurial/revlog.py", line *, in _insertflagprocessor (glob)
211 raise error.Abort(msg)
211 raise error.Abort(msg)
212 mercurial.error.Abort: b"cannot register multiple processors on flag '0x8'." (py3 !)
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