Mercurial > hg
comparison tests/flagprocessorext.py @ 35570:3e3f4c03876b
tests: add b'' to string literals where bytes are required
Since we are internally dealing with bytes only, we need to use bytes in the
tests too. This is one of the many patches which will make all the tests
completely use bytes.
# skip-blame because we are just adding b''
Differential Revision: https://phab.mercurial-scm.org/D1788
author | Pulkit Goyal <7895pulkit@gmail.com> |
---|---|
date | Fri, 29 Dec 2017 03:37:36 +0530 |
parents | 77f746e5383a |
children | 83246d6920f2 |
comparison
equal
deleted
inserted
replaced
35569:964212780daf | 35570:3e3f4c03876b |
---|---|
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): |
61 if '[NOOP]' in text: | 61 if b'[NOOP]' in text: |
62 flags |= REVIDX_NOOP | 62 flags |= REVIDX_NOOP |
63 return orig(self, text, transaction, link, p1, p2, cachedelta=cachedelta, | 63 return orig(self, text, transaction, link, p1, p2, cachedelta=cachedelta, |
64 node=node, flags=flags) | 64 node=node, flags=flags) |
65 | 65 |
66 def b64addrevision(orig, self, text, transaction, link, p1, p2, | 66 def b64addrevision(orig, self, text, transaction, link, p1, p2, |
67 cachedelta=None, node=None, | 67 cachedelta=None, node=None, |
68 flags=revlog.REVIDX_DEFAULT_FLAGS): | 68 flags=revlog.REVIDX_DEFAULT_FLAGS): |
69 if '[BASE64]' in text: | 69 if b'[BASE64]' in text: |
70 flags |= REVIDX_BASE64 | 70 flags |= REVIDX_BASE64 |
71 return orig(self, text, transaction, link, p1, p2, cachedelta=cachedelta, | 71 return orig(self, text, transaction, link, p1, p2, cachedelta=cachedelta, |
72 node=node, flags=flags) | 72 node=node, flags=flags) |
73 | 73 |
74 def gzipaddrevision(orig, self, text, transaction, link, p1, p2, | 74 def gzipaddrevision(orig, self, text, transaction, link, p1, p2, |
75 cachedelta=None, node=None, | 75 cachedelta=None, node=None, |
76 flags=revlog.REVIDX_DEFAULT_FLAGS): | 76 flags=revlog.REVIDX_DEFAULT_FLAGS): |
77 if '[GZIP]' in text: | 77 if b'[GZIP]' in text: |
78 flags |= REVIDX_GZIP | 78 flags |= REVIDX_GZIP |
79 return orig(self, text, transaction, link, p1, p2, cachedelta=cachedelta, | 79 return orig(self, text, transaction, link, p1, p2, cachedelta=cachedelta, |
80 node=node, flags=flags) | 80 node=node, flags=flags) |
81 | 81 |
82 def failaddrevision(orig, self, text, transaction, link, p1, p2, | 82 def failaddrevision(orig, self, text, transaction, link, p1, p2, |
83 cachedelta=None, node=None, | 83 cachedelta=None, node=None, |
84 flags=revlog.REVIDX_DEFAULT_FLAGS): | 84 flags=revlog.REVIDX_DEFAULT_FLAGS): |
85 # This addrevision wrapper is meant to add a flag we will not have | 85 # This addrevision wrapper is meant to add a flag we will not have |
86 # transforms registered for, ensuring we handle this error case. | 86 # transforms registered for, ensuring we handle this error case. |
87 if '[FAIL]' in text: | 87 if b'[FAIL]' in text: |
88 flags |= REVIDX_FAIL | 88 flags |= REVIDX_FAIL |
89 return orig(self, text, transaction, link, p1, p2, cachedelta=cachedelta, | 89 return orig(self, text, transaction, link, p1, p2, cachedelta=cachedelta, |
90 node=node, flags=flags) | 90 node=node, flags=flags) |
91 | 91 |
92 def extsetup(ui): | 92 def extsetup(ui): |