Patchwork [4,of,5] py3: journal: namedtuple takes unicode

login
register
mail settings
Submitter Mateusz Kwapich
Date Oct. 9, 2016, 1:55 p.m.
Message ID <09060ee32a5cd51cdcfa.1476021311@devvm314.lla2.facebook.com>
Download mbox | patch
Permalink /patch/16995/
State Changes Requested
Headers show

Comments

Mateusz Kwapich - Oct. 9, 2016, 1:55 p.m.
# HG changeset patch
# User Mateusz Kwapich <mitrandir@fb.com>
# Date 1476021128 25200
#      Sun Oct 09 06:52:08 2016 -0700
# Node ID 09060ee32a5cd51cdcfa42b23312ca17a11fc713
# Parent  dd705da68bdc7e52ca7a06e92e0fb6e74af6647b
py3: journal: namedtuple takes unicode

consistent namedtuple usage in changelog.py:141
Yuya Nishihara - Oct. 9, 2016, 3:40 p.m.
On Sun, 9 Oct 2016 06:55:11 -0700, Mateusz Kwapich wrote:
> # HG changeset patch
> # User Mateusz Kwapich <mitrandir@fb.com>
> # Date 1476021128 25200
> #      Sun Oct 09 06:52:08 2016 -0700
> # Node ID 09060ee32a5cd51cdcfa42b23312ca17a11fc713
> # Parent  dd705da68bdc7e52ca7a06e92e0fb6e74af6647b
> py3: journal: namedtuple takes unicode

check-commit complains about the double topics. Can you update them and
resend?

+  Revision 2ebfc0f1aa92 does not comply with rules
+  ------------------------------------------------------
+  6: summary keyword should be most user-relevant one-word command or topic
+   py3: journal: namedtuple takes unicode
+
+  Revision 61aa5a8ca6eb does not comply with rules
+  ------------------------------------------------------
+  6: summary keyword should be most user-relevant one-word command or topic
+   py3: convert: user raw strings in all lines

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
@@ -22,7 +22,6 @@ 
   hgext/fsmonitor/pywatchman/capabilities.py: error importing: <SyntaxError> invalid or missing encoding declaration (error at __init__.py:*)
   hgext/fsmonitor/pywatchman/pybser.py: error importing: <SyntaxError> invalid or missing encoding declaration (error at __init__.py:*)
   hgext/fsmonitor/watchmanclient.py: error importing: <SyntaxError> invalid or missing encoding declaration (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:*)