Patchwork [1,of,2,V2] py3: namedtuple takes unicode (journal ext)

login
register
mail settings
Submitter Mateusz Kwapich
Date Oct. 10, 2016, 12:44 p.m.
Message ID <aeda1ae1dab23ba64880.1476103450@devvm314.lla2.facebook.com>
Download mbox | patch
Permalink /patch/17023/
State Accepted
Headers show

Comments

Mateusz Kwapich - Oct. 10, 2016, 12:44 p.m.
# HG changeset patch
# User Mateusz Kwapich <mitrandir@fb.com>
# Date 1476102614 25200
#      Mon Oct 10 05:30:14 2016 -0700
# Node ID aeda1ae1dab23ba648806a632d86b49d802c84c0
# Parent  8d079c0594b35dfbf57baf8d83fde686a946920a
py3: namedtuple takes unicode (journal ext)

namedtuple usage consistent with changelog.py:141
Yuya Nishihara - Oct. 10, 2016, 7:56 p.m.
On Mon, 10 Oct 2016 05:44:10 -0700, Mateusz Kwapich wrote:
> # HG changeset patch
> # User Mateusz Kwapich <mitrandir@fb.com>
> # Date 1476102614 25200
> #      Mon Oct 10 05:30:14 2016 -0700
> # Node ID aeda1ae1dab23ba648806a632d86b49d802c84c0
> # Parent  8d079c0594b35dfbf57baf8d83fde686a946920a
> py3: namedtuple takes unicode (journal ext)

Queued them, thanks.

Patch

diff --git a/hgext/journal.py b/hgext/journal.py
--- a/hgext/journal.py
+++ b/hgext/journal.py
@@ -177,8 +177,8 @@  def unsharejournal(orig, ui, repo, repop
     return orig(ui, repo, repopath)
 
 class journalentry(collections.namedtuple(
-        'journalentry',
-        'timestamp user command namespace name oldhashes newhashes')):
+        u'journalentry',
+        u'timestamp user command namespace name oldhashes newhashes')):
     """Individual journal entry
 
     * timestamp: a mercurial (time, timezone) tuple
diff --git a/tests/test-check-py3-compat.t b/tests/test-check-py3-compat.t
--- a/tests/test-check-py3-compat.t
+++ b/tests/test-check-py3-compat.t
@@ -23,7 +23,6 @@ 
   hgext/fsmonitor/pywatchman/capabilities.py: error importing: <ImportError> No module named 'pybser' (error at __init__.py:*)
   hgext/fsmonitor/pywatchman/pybser.py: error importing: <ImportError> No module named 'pybser' (error at __init__.py:*)
   hgext/fsmonitor/watchmanclient.py: error importing: <ImportError> No module named 'pybser' (error at __init__.py:*)
-  hgext/journal.py: error importing: <ValueError> Type names and field names must be valid identifiers: "b'journalentry'" (error at journal.py:*)
   hgext/largefiles/basestore.py: error importing: <SyntaxError> cannot mix bytes and nonbytes literals (subversion.py, line 533) (error at convcmd.py:*)
   hgext/largefiles/lfcommands.py: error importing: <SyntaxError> cannot mix bytes and nonbytes literals (subversion.py, line 533) (error at convcmd.py:*)
   hgext/largefiles/lfutil.py: error importing: <SyntaxError> cannot mix bytes and nonbytes literals (subversion.py, line 533) (error at convcmd.py:*)