Mercurial > hg-stable
changeset 38700:cfdf7bfb0ac0
py3: don't str() to byte-stringify object in test-bundle2-remote-changegroup.t
author | Yuya Nishihara <yuya@tcha.org> |
---|---|
date | Sun, 08 Jul 2018 19:44:51 +0900 |
parents | 72c086b1af12 |
children | f016eac2a466 |
files | tests/test-bundle2-remote-changegroup.t |
diffstat | 1 files changed, 10 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/tests/test-bundle2-remote-changegroup.t Sun Jul 08 19:39:11 2018 +0900 +++ b/tests/test-bundle2-remote-changegroup.t Sun Jul 08 19:44:51 2018 +0900 @@ -16,7 +16,14 @@ > Current bundle2 implementation doesn't provide a way to generate those > parts, so they must be created by extensions. > """ - > from mercurial import bundle2, changegroup, discovery, exchange, util + > from mercurial import ( + > bundle2, + > changegroup, + > discovery, + > exchange, + > pycompat, + > util, + > ) > > def _getbundlechangegrouppart(bundler, repo, source, bundlecaps=None, > b2caps=None, heads=None, common=None, @@ -60,13 +67,13 @@ > d = util.digester([digest], bundledata) > part = newpart(b'remote-changegroup') > part.addparam(b'url', url) - > part.addparam(b'size', str(len(bundledata))) + > part.addparam(b'size', b'%d' % len(bundledata)) > part.addparam(b'digests', digest) > part.addparam(b'digest:%s' % digest, d[digest]) > elif verb == b'raw-remote-changegroup': > part = newpart(b'remote-changegroup') > for k, v in eval(args).items(): - > part.addparam(k, str(v)) + > part.addparam(pycompat.sysbytes(k), pycompat.bytestr(v)) > elif verb == b'changegroup': > _common, heads = args.split() > common.extend(repo[r].node() for r in repo.revs(_common))