Mercurial > hg > mercurial-source
comparison tests/test-revlog-raw.py @ 43772:bd5858c28bbe
flagprocessors: have the read transform function return side data (API)
This makes it possible for flag processors to -read- flag data.
Differential Revision: https://phab.mercurial-scm.org/D6813
author | Pierre-Yves David <pierre-yves.david@octobus.net> |
---|---|
date | Wed, 04 Sep 2019 00:34:03 +0200 |
parents | 740450677221 |
children | f4caf910669e |
comparison
equal
deleted
inserted
replaced
43771:66dc5a522f37 | 43772:bd5858c28bbe |
---|---|
43 _extheader = b'E\n' | 43 _extheader = b'E\n' |
44 | 44 |
45 def readprocessor(self, rawtext): | 45 def readprocessor(self, rawtext): |
46 # True: the returned text could be used to verify hash | 46 # True: the returned text could be used to verify hash |
47 text = rawtext[len(_extheader):].replace(b'i', b'1') | 47 text = rawtext[len(_extheader):].replace(b'i', b'1') |
48 return text, True | 48 return text, True, {} |
49 | 49 |
50 def writeprocessor(self, text): | 50 def writeprocessor(self, text): |
51 # False: the returned rawtext shouldn't be used to verify hash | 51 # False: the returned rawtext shouldn't be used to verify hash |
52 rawtext = _extheader + text.replace(b'1', b'i') | 52 rawtext = _extheader + text.replace(b'1', b'i') |
53 return rawtext, False | 53 return rawtext, False |