py3: use encoding.strfromlocal() instead of pycompat.sysstr()
authorPulkit Goyal <7895pulkit@gmail.com>
Mon, 21 May 2018 23:26:53 +0530
changeset 38157 282f3daac1d7
parent 38156 f44306940c94
child 38158 6ef01102ebff
py3: use encoding.strfromlocal() instead of pycompat.sysstr() opts['dateformat'] is provided by the user and can be encoded in local encoding. Thanks to Yuya for catching. Differential Revision: https://phab.mercurial-scm.org/D3642
hgext/churn.py
--- a/hgext/churn.py	Sun May 20 23:05:18 2018 -0400
+++ b/hgext/churn.py	Mon May 21 23:26:53 2018 +0530
@@ -52,7 +52,7 @@
         def getkey(ctx):
             t, tz = ctx.date()
             date = datetime.datetime(*time.gmtime(float(t) - tz)[:6])
-            return date.strftime(pycompat.sysstr(opts['dateformat']))
+            return date.strftime(encoding.strfromlocal(opts['dateformat']))
     else:
         tmpl = opts.get('oldtemplate') or opts.get('template')
         tmpl = logcmdutil.maketemplater(ui, repo, tmpl)