churn: fix stack traces on Python 3
authorAugie Fackler <augie@google.com>
Sat, 13 Oct 2018 05:58:16 -0400
changeset 40240 6f3e733848ae
parent 40239 379dd054614b
child 40241 81e4f039a0cd
churn: fix stack traces on Python 3 Differential Revision: https://phab.mercurial-scm.org/D5062
hgext/churn.py
--- a/hgext/churn.py	Sat Oct 13 04:00:57 2018 -0400
+++ b/hgext/churn.py	Sat Oct 13 05:58:16 2018 -0400
@@ -52,7 +52,8 @@
         def getkey(ctx):
             t, tz = ctx.date()
             date = datetime.datetime(*time.gmtime(float(t) - tz)[:6])
-            return date.strftime(encoding.strfromlocal(opts['dateformat']))
+            return encoding.strtolocal(
+                date.strftime(encoding.strfromlocal(opts['dateformat'])))
     else:
         tmpl = opts.get('oldtemplate') or opts.get('template')
         tmpl = logcmdutil.maketemplater(ui, repo, tmpl)