[PATCH 09 of 10] py3: use unicode literals in changelog.py

Yuya Nishihara yuya at tcha.org
Wed Aug 3 10:26:56 EDT 2016


On Wed, 03 Aug 2016 01:57:31 +0530, Pulkit Goyal wrote:
> # HG changeset patch
> # User Pulkit Goyal <7895pulkit at gmail.com>
> # Date 1470169051 -19800
> #      Wed Aug 03 01:47:31 2016 +0530
> # Node ID bb24dfbbd410cd78646c43557c06475f9d252dd5
> # Parent  f7cb9b3eeac9c22dc76f6c5976fda488ba992be2
> py3: use unicode literals in changelog.py
> 
> collections.namedtuple type and field names must be str in Python 3.
> Our custom module importer was rewriting them to bytes literals,
> making this fail.
> 
> In addition, __slots__ values must also be unicode.
> 
> diff -r f7cb9b3eeac9 -r bb24dfbbd410 mercurial/changelog.py
> --- a/mercurial/changelog.py	Wed Aug 03 01:43:25 2016 +0530
> +++ b/mercurial/changelog.py	Wed Aug 03 01:47:31 2016 +0530
> @@ -138,9 +138,9 @@
>          return appender(opener, name, mode, buf)
>      return _delay
>  
> -_changelogrevision = collections.namedtuple('changelogrevision',
> -                                            ('manifest', 'user', 'date',
> -                                             'files', 'description', 'extra'))
> +_changelogrevision = collections.namedtuple(u'changelogrevision',
> +                                            (u'manifest', u'user', u'date',
> +                                             u'files', u'description', u'extra'))

This and the last patch looked okay, but there's a check-code error.

+  mercurial/changelog.py:143:
+   >                                              u'files', u'description', u'extra'))
+   line too long


More information about the Mercurial-devel mailing list