comparison tests/test-bundle2-multiple-changegroups.t @ 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 4441705b7111
children e8a71ed9c373
comparison
equal deleted inserted replaced
35569:964212780daf 35570:3e3f4c03876b
11 > # Create two changegroups given the common changesets and heads for the 11 > # Create two changegroups given the common changesets and heads for the
12 > # changegroup part we are being requested. Use the parent of each head 12 > # changegroup part we are being requested. Use the parent of each head
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
37 > [ui] 37 > [ui]
38 > logtemplate={rev}:{node|short} {phase} {author} {bookmarks} {desc|firstline} 38 > logtemplate={rev}:{node|short} {phase} {author} {bookmarks} {desc|firstline}