[PATCH 5 of 7] exchange: use pycompat.bytestr() instead of str() to encode ints

Yuya Nishihara yuya at tcha.org
Thu Aug 31 09:57:48 EDT 2017


On Tue, 29 Aug 2017 11:22:02 -0400, Augie Fackler wrote:
> # HG changeset patch
> # User Augie Fackler <raf at durin42.com>
> # Date 1503451273 14400
> #      Tue Aug 22 21:21:13 2017 -0400
> # Node ID 8d65029a473f6ff1b1fde49403dd467caf3fd1c0
> # Parent  26ac215809cffdee88cb32e13e2728f6830e0d84
> exchange: use pycompat.bytestr() instead of str() to encode ints
> 
> diff --git a/mercurial/exchange.py b/mercurial/exchange.py
> --- a/mercurial/exchange.py
> +++ b/mercurial/exchange.py
> @@ -792,8 +792,8 @@ def _pushb2phases(pushop, bundler):
>          part = bundler.newpart('pushkey')
>          part.addparam('namespace', enc('phases'))
>          part.addparam('key', enc(newremotehead.hex()))
> -        part.addparam('old', enc(str(phases.draft)))
> -        part.addparam('new', enc(str(phases.public)))
> +        part.addparam('old', enc(pycompat.bytestr(phases.draft)))
> +        part.addparam('new', enc(pycompat.bytestr(phases.public)))

'%d' is preferable here.


More information about the Mercurial-devel mailing list