changeset 38173:220058198be6

hgweb: don't use dict(key=value) to build a mapping dict in filelog It wasn't Py3 compatible because mapping keys must be bytes.
author Yuya Nishihara <yuya@tcha.org>
date Wed, 04 Apr 2018 20:37:03 +0900
parents d32f07069dd1
children 53cc81a8caf6
files mercurial/hgweb/webcommands.py
diffstat 1 files changed, 18 insertions(+), 14 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/hgweb/webcommands.py	Wed Apr 04 20:31:16 2018 +0900
+++ b/mercurial/hgweb/webcommands.py	Wed Apr 04 20:37:03 2018 +0900
@@ -1090,13 +1090,15 @@
                 diffs = diff(c, linerange=lr)
             # follow renames accross filtered (not in range) revisions
             path = c.path()
-            entries.append(dict(
-                parity=next(parity),
-                filerev=c.rev(),
-                file=path,
-                diff=diffs,
-                linerange=webutil.formatlinerange(*lr),
-                **pycompat.strkwargs(webutil.commonentry(repo, c))))
+            lm = webutil.commonentry(repo, c)
+            lm.update({
+                'parity': next(parity),
+                'filerev': c.rev(),
+                'file': path,
+                'diff': diffs,
+                'linerange': webutil.formatlinerange(*lr),
+            })
+            entries.append(lm)
             if i == revcount:
                 break
         lessvars['linerange'] = webutil.formatlinerange(*lrange)
@@ -1107,13 +1109,15 @@
             diffs = None
             if patch:
                 diffs = diff(iterfctx)
-            entries.append(dict(
-                parity=next(parity),
-                filerev=i,
-                file=f,
-                diff=diffs,
-                rename=webutil.renamelink(iterfctx),
-                **pycompat.strkwargs(webutil.commonentry(repo, iterfctx))))
+            lm = webutil.commonentry(repo, iterfctx)
+            lm.update({
+                'parity': next(parity),
+                'filerev': i,
+                'file': f,
+                'diff': diffs,
+                'rename': webutil.renamelink(iterfctx),
+            })
+            entries.append(lm)
         entries.reverse()
         revnav = webutil.filerevnav(web.repo, fctx.path())
         nav = revnav.gen(end - 1, revcount, count)