##// END OF EJS Templates
tests: add b'' to string literals where bytes are required...
Pulkit Goyal -
r35588:3e3f4c03 default
parent child Browse files
Show More
@@ -13,9 +13,9 b' if sys.argv[1] != "user@dummy":'
13 os.environ["SSH_CLIENT"] = "%s 1 2" % os.environ.get('LOCALIP', '127.0.0.1')
13 os.environ["SSH_CLIENT"] = "%s 1 2" % os.environ.get('LOCALIP', '127.0.0.1')
14
14
15 log = open("dummylog", "ab")
15 log = open("dummylog", "ab")
16 log.write("Got arguments")
16 log.write(b"Got arguments")
17 for i, arg in enumerate(sys.argv[1:]):
17 for i, arg in enumerate(sys.argv[1:]):
18 log.write(" %d:%s" % (i + 1, arg))
18 log.write(b" %d:%s" % (i + 1, arg))
19 log.write("\n")
19 log.write("\n")
20 log.close()
20 log.close()
21 hgcmd = sys.argv[2]
21 hgcmd = sys.argv[2]
@@ -58,7 +58,7 b' def allsupportedversions(orig, ui):'
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)
@@ -66,7 +66,7 b' def noopaddrevision(orig, self, text, tr'
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)
@@ -74,7 +74,7 b' def b64addrevision(orig, self, text, tra'
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)
@@ -84,7 +84,7 b' def failaddrevision(orig, self, text, tr'
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)
@@ -22,27 +22,27 b' import os'
22 import sys
22 import sys
23
23
24 files = [
24 files = [
25 ('formatv0/.hg/00changelog.i',
25 (b'formatv0/.hg/00changelog.i',
26 '000000000000004400000000000000000000000000000000000000'
26 b'000000000000004400000000000000000000000000000000000000'
27 '000000000000000000000000000000000000000000000000000000'
27 b'000000000000000000000000000000000000000000000000000000'
28 '0000a1ef0b125355d27765928be600cfe85784284ab3'),
28 b'0000a1ef0b125355d27765928be600cfe85784284ab3'),
29 ('formatv0/.hg/00changelog.d',
29 (b'formatv0/.hg/00changelog.d',
30 '756163613935613961356635353036303562366138343738336237'
30 b'756163613935613961356635353036303562366138343738336237'
31 '61623536363738616436356635380a757365720a3020300a656d70'
31 b'61623536363738616436356635380a757365720a3020300a656d70'
32 '74790a0a656d7074792066696c65'),
32 b'74790a0a656d7074792066696c65'),
33 ('formatv0/.hg/00manifest.i',
33 (b'formatv0/.hg/00manifest.i',
34 '000000000000003000000000000000000000000000000000000000'
34 b'000000000000003000000000000000000000000000000000000000'
35 '000000000000000000000000000000000000000000000000000000'
35 b'000000000000000000000000000000000000000000000000000000'
36 '0000aca95a9a5f550605b6a84783b7ab56678ad65f58'),
36 b'0000aca95a9a5f550605b6a84783b7ab56678ad65f58'),
37 ('formatv0/.hg/00manifest.d',
37 (b'formatv0/.hg/00manifest.d',
38 '75656d707479006238306465356431333837353835343163356630'
38 b'75656d707479006238306465356431333837353835343163356630'
39 '35323635616431343461623966613836643164620a'),
39 b'35323635616431343461623966613836643164620a'),
40 ('formatv0/.hg/data/empty.i',
40 (b'formatv0/.hg/data/empty.i',
41 '000000000000000000000000000000000000000000000000000000'
41 b'000000000000000000000000000000000000000000000000000000'
42 '000000000000000000000000000000000000000000000000000000'
42 b'000000000000000000000000000000000000000000000000000000'
43 '0000b80de5d138758541c5f05265ad144ab9fa86d1db'),
43 b'0000b80de5d138758541c5f05265ad144ab9fa86d1db'),
44 ('formatv0/.hg/data/empty.d',
44 (b'formatv0/.hg/data/empty.d',
45 ''),
45 b''),
46 ]
46 ]
47
47
48 def makedirs(name):
48 def makedirs(name):
@@ -13,24 +13,24 b' Create an extension to test bundle2 with'
13 > # in 'heads' as intermediate heads for the first changegroup.
13 > # in 'heads' as intermediate heads for the first changegroup.
14 > intermediates = [repo[r].p1().node() for r in heads]
14 > intermediates = [repo[r].p1().node() for r in heads]
15 > outgoing = discovery.outgoing(repo, common, intermediates)
15 > outgoing = discovery.outgoing(repo, common, intermediates)
16 > cg = changegroup.makechangegroup(repo, outgoing, '01',
16 > cg = changegroup.makechangegroup(repo, outgoing, b'01',
17 > source, bundlecaps=bundlecaps)
17 > source, bundlecaps=bundlecaps)
18 > bundler.newpart('output', data='changegroup1')
18 > bundler.newpart(b'output', data=b'changegroup1')
19 > bundler.newpart('changegroup', data=cg.getchunks())
19 > bundler.newpart(b'changegroup', data=cg.getchunks())
20 > outgoing = discovery.outgoing(repo, common + intermediates, heads)
20 > outgoing = discovery.outgoing(repo, common + intermediates, heads)
21 > cg = changegroup.makechangegroup(repo, outgoing, '01',
21 > cg = changegroup.makechangegroup(repo, outgoing, b'01',
22 > source, bundlecaps=bundlecaps)
22 > source, bundlecaps=bundlecaps)
23 > bundler.newpart('output', data='changegroup2')
23 > bundler.newpart(b'output', data=b'changegroup2')
24 > bundler.newpart('changegroup', data=cg.getchunks())
24 > bundler.newpart(b'changegroup', data=cg.getchunks())
25 >
25 >
26 > def _pull(repo, *args, **kwargs):
26 > def _pull(repo, *args, **kwargs):
27 > pullop = _orig_pull(repo, *args, **kwargs)
27 > pullop = _orig_pull(repo, *args, **kwargs)
28 > repo.ui.write('pullop.cgresult is %d\n' % pullop.cgresult)
28 > repo.ui.write(b'pullop.cgresult is %d\n' % pullop.cgresult)
29 > return pullop
29 > return pullop
30 >
30 >
31 > _orig_pull = exchange.pull
31 > _orig_pull = exchange.pull
32 > exchange.pull = _pull
32 > exchange.pull = _pull
33 > exchange.getbundle2partsmapping['changegroup'] = _getbundlechangegrouppart
33 > exchange.getbundle2partsmapping[b'changegroup'] = _getbundlechangegrouppart
34 > EOF
34 > EOF
35
35
36 $ cat >> $HGRCPATH << EOF
36 $ cat >> $HGRCPATH << EOF
@@ -35,7 +35,7 b' Narrow diffstat:'
35
35
36 $ hg ci -m appenda
36 $ hg ci -m appenda
37
37
38 >>> open("c", "wb").write("\0")
38 >>> open("c", "wb").write(b"\0")
39 $ touch d
39 $ touch d
40 $ hg add c d
40 $ hg add c d
41
41
@@ -54,7 +54,7 b' Binary git diffstat:'
54
54
55 $ hg ci -m createb
55 $ hg ci -m createb
56
56
57 >>> open("file with spaces", "wb").write("\0")
57 >>> open("file with spaces", "wb").write(b"\0")
58 $ hg add "file with spaces"
58 $ hg add "file with spaces"
59
59
60 Filename with spaces diffstat:
60 Filename with spaces diffstat:
General Comments 0
You need to be logged in to leave comments. Login now