Mercurial > hg
comparison tests/flagprocessorext.py @ 36114:83246d6920f2
py3: use b'' for changegroup version literals
Test extensions aren't currently loaded with our custom module
importer.
# skip-blame b prefix
Differential Revision: https://phab.mercurial-scm.org/D2161
author | Gregory Szorc <gregory.szorc@gmail.com> |
---|---|
date | Sun, 11 Feb 2018 16:40:02 -0800 |
parents | 3e3f4c03876b |
children | 6c7a6b04b274 |
comparison
equal
deleted
inserted
replaced
36113:a42817fede27 | 36114:83246d6920f2 |
---|---|
43 def gzipdecompress(self, text): | 43 def gzipdecompress(self, text): |
44 return (zlib.decompress(text), True) | 44 return (zlib.decompress(text), True) |
45 | 45 |
46 def supportedoutgoingversions(orig, repo): | 46 def supportedoutgoingversions(orig, repo): |
47 versions = orig(repo) | 47 versions = orig(repo) |
48 versions.discard('01') | 48 versions.discard(b'01') |
49 versions.discard('02') | 49 versions.discard(b'02') |
50 versions.add('03') | 50 versions.add(b'03') |
51 return versions | 51 return versions |
52 | 52 |
53 def allsupportedversions(orig, ui): | 53 def allsupportedversions(orig, ui): |
54 versions = orig(ui) | 54 versions = orig(ui) |
55 versions.add('03') | 55 versions.add(b'03') |
56 return versions | 56 return versions |
57 | 57 |
58 def noopaddrevision(orig, self, text, transaction, link, p1, p2, | 58 def noopaddrevision(orig, self, text, transaction, link, p1, p2, |
59 cachedelta=None, node=None, | 59 cachedelta=None, node=None, |
60 flags=revlog.REVIDX_DEFAULT_FLAGS): | 60 flags=revlog.REVIDX_DEFAULT_FLAGS): |
104 revlog.REVIDX_KNOWN_FLAGS |= util.bitsfrom(flags) | 104 revlog.REVIDX_KNOWN_FLAGS |= util.bitsfrom(flags) |
105 revlog.REVIDX_FLAGS_ORDER.extend(flags) | 105 revlog.REVIDX_FLAGS_ORDER.extend(flags) |
106 | 106 |
107 # Teach exchange to use changegroup 3 | 107 # Teach exchange to use changegroup 3 |
108 for k in exchange._bundlespeccgversions.keys(): | 108 for k in exchange._bundlespeccgversions.keys(): |
109 exchange._bundlespeccgversions[k] = '03' | 109 exchange._bundlespeccgversions[k] = b'03' |
110 | 110 |
111 # Add wrappers for addrevision, responsible to set flags depending on the | 111 # Add wrappers for addrevision, responsible to set flags depending on the |
112 # revision data contents. | 112 # revision data contents. |
113 wrapfunction(filelog.filelog, 'addrevision', noopaddrevision) | 113 wrapfunction(filelog.filelog, 'addrevision', noopaddrevision) |
114 wrapfunction(filelog.filelog, 'addrevision', b64addrevision) | 114 wrapfunction(filelog.filelog, 'addrevision', b64addrevision) |