Patchwork [4,of,4] fastannotate: use stringutil.pprint() to dump diffopts to be hashed

login
register
mail settings
Submitter Yuya Nishihara
Date Sept. 1, 2018, 1:55 a.m.
Message ID <f6485547bb05391915fd.1535766942@mimosa>
Download mbox | patch
Permalink /patch/34228/
State Accepted
Headers show

Comments

Yuya Nishihara - Sept. 1, 2018, 1:55 a.m.
# HG changeset patch
# User Yuya Nishihara <yuya@tcha.org>
# Date 1535766048 -32400
#      Sat Sep 01 10:40:48 2018 +0900
# Node ID f6485547bb05391915fdf520836d3dd65367f161
# Parent  570df3c1e1e7bb7592cd61b6bb41f961afdb59ba
fastannotate: use stringutil.pprint() to dump diffopts to be hashed

Patch

diff --git a/hgext/fastannotate/context.py b/hgext/fastannotate/context.py
--- a/hgext/fastannotate/context.py
+++ b/hgext/fastannotate/context.py
@@ -23,6 +23,9 @@  from mercurial import (
     scmutil,
     util,
 )
+from mercurial.utils import (
+    stringutil,
+)
 
 from . import (
     error as faerror,
@@ -131,7 +134,7 @@  def encodedir(path):
             .replace('.lock/', '.lock.hg/'))
 
 def hashdiffopts(diffopts):
-    diffoptstr = str(sorted(
+    diffoptstr = stringutil.pprint(sorted(
         (k, getattr(diffopts, k))
         for k in mdiff.diffopts.defaults
     ))
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
@@ -31,11 +31,6 @@ 
   > | sed 's|\\|/|g' | xargs python3 contrib/check-py3-compat.py \
   > | sed 's/[0-9][0-9]*)$/*)/'
   hgext/convert/transport.py: error importing: <*Error> No module named 'svn.client' (error at transport.py:*) (glob) (?)
-  hgext/fastannotate/commands.py: error importing: <TypeError> Unicode-objects must be encoded before hashing (error at context.py:*)
-  hgext/fastannotate/context.py: error importing: <TypeError> Unicode-objects must be encoded before hashing (error at context.py:*)
-  hgext/fastannotate/formatter.py: error importing: <TypeError> Unicode-objects must be encoded before hashing (error at context.py:*)
-  hgext/fastannotate/protocol.py: error importing: <TypeError> Unicode-objects must be encoded before hashing (error at context.py:*)
-  hgext/fastannotate/support.py: error importing: <TypeError> Unicode-objects must be encoded before hashing (error at context.py:*)
   hgext/infinitepush/sqlindexapi.py: error importing: <*Error> No module named 'mysql' (error at sqlindexapi.py:*) (glob) (?)
   mercurial/scmwindows.py: error importing: <ValueError> _type_ 'v' not supported (error at win32.py:*) (no-windows !)
   mercurial/win32.py: error importing: <ValueError> _type_ 'v' not supported (error at win32.py:*) (no-windows !)