##// END OF EJS Templates
flagprocessors: return flagdata in the main processing function...
marmoute -
r43254:66dc5a52 default
parent child Browse files
Show More
@@ -118,8 +118,7 b' class flagprocessorsmixin(object):'
118 processed text and ``validatehash`` is a bool indicating whether the
118 processed text and ``validatehash`` is a bool indicating whether the
119 returned text should be checked for hash integrity.
119 returned text should be checked for hash integrity.
120 """
120 """
121 text, vhash = self._processflagsfunc(text, flags, 'read')
121 return self._processflagsfunc(text, flags, 'read')
122 return text, vhash, {}
123
122
124 def _processflagswrite(self, text, flags):
123 def _processflagswrite(self, text, flags):
125 """Inspect revision data flags and applies write transformations defined
124 """Inspect revision data flags and applies write transformations defined
@@ -137,7 +136,7 b' class flagprocessorsmixin(object):'
137 processed text and ``validatehash`` is a bool indicating whether the
136 processed text and ``validatehash`` is a bool indicating whether the
138 returned text should be checked for hash integrity.
137 returned text should be checked for hash integrity.
139 """
138 """
140 return self._processflagsfunc(text, flags, 'write')
139 return self._processflagsfunc(text, flags, 'write')[:2]
141
140
142 def _processflagsraw(self, text, flags):
141 def _processflagsraw(self, text, flags):
143 """Inspect revision data flags to check is the content hash should be
142 """Inspect revision data flags to check is the content hash should be
@@ -160,7 +159,7 b' class flagprocessorsmixin(object):'
160 def _processflagsfunc(self, text, flags, operation):
159 def _processflagsfunc(self, text, flags, operation):
161 # fast path: no flag processors will run
160 # fast path: no flag processors will run
162 if flags == 0:
161 if flags == 0:
163 return text, True
162 return text, True, {}
164 if operation not in ('read', 'write', 'raw'):
163 if operation not in ('read', 'write', 'raw'):
165 raise error.ProgrammingError(_("invalid '%s' operation") %
164 raise error.ProgrammingError(_("invalid '%s' operation") %
166 operation)
165 operation)
@@ -175,6 +174,7 b' class flagprocessorsmixin(object):'
175 if operation == 'write':
174 if operation == 'write':
176 orderedflags = reversed(orderedflags)
175 orderedflags = reversed(orderedflags)
177
176
177 outsidedata = {}
178 for flag in orderedflags:
178 for flag in orderedflags:
179 # If a flagprocessor has been registered for a known flag, apply the
179 # If a flagprocessor has been registered for a known flag, apply the
180 # related operation transform and update result tuple.
180 # related operation transform and update result tuple.
@@ -197,4 +197,4 b' class flagprocessorsmixin(object):'
197 text, vhash = writetransform(self, text)
197 text, vhash = writetransform(self, text)
198 validatehash = validatehash and vhash
198 validatehash = validatehash and vhash
199
199
200 return text, validatehash
200 return text, validatehash, outsidedata
General Comments 0
You need to be logged in to leave comments. Login now