Patchwork D2554: templatekw: fix dict construction in _showlist to not mix bytes and strs

login
register
mail settings
Submitter phabricator
Date March 2, 2018, 2:51 p.m.
Message ID <differential-rev-PHID-DREV-q3f4ybzff6bg5qcbgitn-req@phab.mercurial-scm.org>
Download mbox | patch
Permalink /patch/28685/
State Superseded
Headers show

Comments

phabricator - March 2, 2018, 2:51 p.m.
durin42 created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  What we had was fine on Python 2, but was slightly wrong on Python
  
  3. This works on both.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  mercurial/templatekw.py

CHANGE DETAILS




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

Patch

diff --git a/mercurial/templatekw.py b/mercurial/templatekw.py
--- a/mercurial/templatekw.py
+++ b/mercurial/templatekw.py
@@ -205,7 +205,9 @@ 
             yield separator.join(values)
         else:
             for v in values:
-                yield dict(v, **strmapping)
+                r = dict(v)
+                r.update(mapping)
+                yield r
         return
     startname = 'start_' + plural
     if startname in templ: