D3642: py3: use encoding.strfromlocal() instead of pycompat.sysstr()

pulkit (Pulkit Goyal) phabricator at mercurial-scm.org
Mon May 21 20:44:50 UTC 2018


pulkit created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  opts['dateformat'] is provided by the user and can be encoded in local encoding.
  Thanks to Yuya for catching.

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D3642

AFFECTED FILES
  hgext/churn.py

CHANGE DETAILS

diff --git a/hgext/churn.py b/hgext/churn.py
--- a/hgext/churn.py
+++ b/hgext/churn.py
@@ -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)



To: pulkit, #hg-reviewers
Cc: mercurial-devel


More information about the Mercurial-devel mailing list