[PATCH 04 of 10 py3] bundle2: correct %s to %d since part ids are integers

Yuya Nishihara yuya at tcha.org
Wed Aug 2 11:34:43 EDT 2017


On Tue, 01 Aug 2017 16:34:32 -0400, Augie Fackler wrote:
> # HG changeset patch
> # User Augie Fackler <augie at google.com>
> # Date 1500909392 14400
> #      Mon Jul 24 11:16:32 2017 -0400
> # Node ID 73208fb1aea975f0d50168860d5bd691cbbad7e7
> # Parent  f50da59f7977c7d796850b95ac7c80a4fd92bd18
> bundle2: correct %s to %d since part ids are integers
> 
> Fixes some Python 3 regressions.
> 
> diff --git a/mercurial/bundle2.py b/mercurial/bundle2.py
> --- a/mercurial/bundle2.py
> +++ b/mercurial/bundle2.py
> @@ -976,7 +976,7 @@ class bundlepart(object):
>              parttype = self.type.upper()
>          else:
>              parttype = self.type.lower()
> -        outdebug(ui, 'part %s: "%s"' % (self.id, parttype))
> +        outdebug(ui, 'part %d: "%s"' % (self.id, parttype))
>          ## parttype
>          header = [_pack(_fparttypesize, len(parttype)),
>                    parttype, _pack(_fpartid, self.id),
> @@ -1213,7 +1213,7 @@ class unbundlepart(unpackermixin):
>          self.type = self._fromheader(typesize)
>          indebug(self.ui, 'part type: "%s"' % self.type)
>          self.id = self._unpackheader(_fpartid)[0]
> -        indebug(self.ui, 'part id: "%s"' % self.id)
> +        indebug(self.ui, 'part id: "%d"' % self.id)

self.id is initialized to None. I'm not pretty sure self.id has an integer
value here. Maybe it's better to use bytestr() instead.


More information about the Mercurial-devel mailing list