Patchwork py3: fix map() use in templatekw.showpredecessors()

login
register
mail settings
Submitter Yuya Nishihara
Date June 14, 2018, 11:37 a.m.
Message ID <6196cc6cd37bc7260fdc.1528976262@mimosa>
Download mbox | patch
Permalink /patch/32126/
State Accepted
Headers show

Comments

Yuya Nishihara - June 14, 2018, 11:37 a.m.
# HG changeset patch
# User Yuya Nishihara <yuya@tcha.org>
# Date 1528975767 -32400
#      Thu Jun 14 20:29:27 2018 +0900
# Node ID 6196cc6cd37bc7260fdcb1f5c020d4adb7f8c176
# Parent  478a74b8f243c79f40f1f0409df40afc0b4ffb9c
py3: fix map() use in templatekw.showpredecessors()

Now it matters since hybrid.tobool() no longer consumes the generator.

Patch

diff --git a/mercurial/templatekw.py b/mercurial/templatekw.py
--- a/mercurial/templatekw.py
+++ b/mercurial/templatekw.py
@@ -567,7 +567,7 @@  def showpredecessors(context, mapping):
     repo = context.resource(mapping, 'repo')
     ctx = context.resource(mapping, 'ctx')
     predecessors = sorted(obsutil.closestpredecessors(repo, ctx.node()))
-    predecessors = map(hex, predecessors)
+    predecessors = pycompat.maplist(hex, predecessors)
 
     return _hybrid(None, predecessors,
                    lambda x: {'ctx': repo[x]},