Patchwork revlog: use pycompat.maplist to eagerly evaluate map on Python 3

login
register
mail settings
Submitter Augie Fackler
Date March 21, 2017, 9:40 p.m.
Message ID <c4547c92a05c9efcf779.1490132402@arthedain.pit.corp.google.com>
Download mbox | patch
Permalink /patch/19539/
State Accepted
Headers show

Comments

Augie Fackler - March 21, 2017, 9:40 p.m.
# HG changeset patch
# User Augie Fackler <augie@google.com>
# Date 1490132389 14400
#      Tue Mar 21 17:39:49 2017 -0400
# Node ID c4547c92a05c9efcf779846f02c1308d1b09ed11
# Parent  e245da2a41b16b28ac48d85e8f70f1216de6e074
revlog: use pycompat.maplist to eagerly evaluate map on Python 3

According to Pulkit, this should fix `hg status --all` on Python 3.
Yuya Nishihara - March 23, 2017, 2:24 p.m.
On Tue, 21 Mar 2017 17:40:02 -0400, Augie Fackler wrote:
> # HG changeset patch
> # User Augie Fackler <augie@google.com>
> # Date 1490132389 14400
> #      Tue Mar 21 17:39:49 2017 -0400
> # Node ID c4547c92a05c9efcf779846f02c1308d1b09ed11
> # Parent  e245da2a41b16b28ac48d85e8f70f1216de6e074
> revlog: use pycompat.maplist to eagerly evaluate map on Python 3

Queued, thanks.

Patch

diff --git a/mercurial/revlog.py b/mercurial/revlog.py
--- a/mercurial/revlog.py
+++ b/mercurial/revlog.py
@@ -943,7 +943,7 @@  class revlog(object):
             ancs = self.index.commonancestorsheads(a, b)
         except (AttributeError, OverflowError): # C implementation failed
             ancs = ancestor.commonancestorsheads(self.parentrevs, a, b)
-        return map(self.node, ancs)
+        return pycompat.maplist(self.node, ancs)
 
     def isancestor(self, a, b):
         """return True if node a is an ancestor of node b