##// END OF EJS Templates
flagprocessors: have the read transform function return side data (API)...
marmoute -
r43255:bd5858c2 default
parent child Browse files
Show More
@@ -104,7 +104,7 b' def readfromstore(self, text):'
104 104 if hgmeta or text.startswith('\1\n'):
105 105 text = storageutil.packmeta(hgmeta, text)
106 106
107 return (text, True)
107 return (text, True, {})
108 108
109 109 def writetostore(self, text):
110 110 # hg filelog metadata (includes rename, etc)
@@ -113,7 +113,7 b" rustdagop = policy.importrust(r'dagop')"
113 113
114 114 # Flag processors for REVIDX_ELLIPSIS.
115 115 def ellipsisreadprocessor(rl, text):
116 return text, False
116 return text, False, {}
117 117
118 118 def ellipsiswriteprocessor(rl, text):
119 119 return text, False
@@ -192,7 +192,8 b' class flagprocessorsmixin(object):'
192 192 if operation == 'raw':
193 193 vhash = rawtransform(self, text)
194 194 elif operation == 'read':
195 text, vhash = readtransform(self, text)
195 text, vhash, s = readtransform(self, text)
196 outsidedata.update(s)
196 197 else: # write operation
197 198 text, vhash = writetransform(self, text)
198 199 validatehash = validatehash and vhash
@@ -33,17 +33,20 b' def bypass(self, text):'
33 33 def noopdonothing(self, text):
34 34 return (text, True)
35 35
36 def noopdonothingread(self, text):
37 return (text, True, {})
38
36 39 def b64encode(self, text):
37 40 return (base64.b64encode(text), False)
38 41
39 42 def b64decode(self, text):
40 return (base64.b64decode(text), True)
43 return (base64.b64decode(text), True, {})
41 44
42 45 def gzipcompress(self, text):
43 46 return (zlib.compress(text), False)
44 47
45 48 def gzipdecompress(self, text):
46 return (zlib.decompress(text), True)
49 return (zlib.decompress(text), True, {})
47 50
48 51 def supportedoutgoingversions(orig, repo):
49 52 versions = orig(repo)
@@ -116,7 +119,7 b' def extsetup(ui):'
116 119 flagutil.addflagprocessor(
117 120 REVIDX_NOOP,
118 121 (
119 noopdonothing,
122 noopdonothingread,
120 123 noopdonothing,
121 124 validatehash,
122 125 )
@@ -45,7 +45,7 b' def abort(msg):'
45 45 def readprocessor(self, rawtext):
46 46 # True: the returned text could be used to verify hash
47 47 text = rawtext[len(_extheader):].replace(b'i', b'1')
48 return text, True
48 return text, True, {}
49 49
50 50 def writeprocessor(self, text):
51 51 # False: the returned rawtext shouldn't be used to verify hash
General Comments 0
You need to be logged in to leave comments. Login now