Patchwork D2369: narrowbundle2: replace map() with equivalent list comprehension

login
register
mail settings
Submitter phabricator
Date Feb. 21, 2018, 5:42 p.m.
Message ID <differential-rev-PHID-DREV-n2sjoc6fexrem3liay2n-req@phab.mercurial-scm.org>
Download mbox | patch
Permalink /patch/28197/
State Superseded
Headers show

Comments

phabricator - Feb. 21, 2018, 5:42 p.m.
durin42 created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  The result of this gets used as a list in core code, so the generator
  returned by map() on Python 3 is a problem.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  hgext/narrow/narrowbundle2.py

CHANGE DETAILS




To: durin42, #hg-reviewers
Cc: mercurial-devel
phabricator - Feb. 22, 2018, 3:10 a.m.
indygreg accepted this revision.
indygreg added a comment.
This revision is now accepted and ready to land.


  I'll fix the double space in flight.

REPOSITORY
  rHG Mercurial

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

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

Patch

diff --git a/hgext/narrow/narrowbundle2.py b/hgext/narrow/narrowbundle2.py
--- a/hgext/narrow/narrowbundle2.py
+++ b/hgext/narrow/narrowbundle2.py
@@ -123,7 +123,7 @@ 
     missing = list(cl.findmissingrevs(common=commonrevs, heads=headsrevs))
     visit = reversed(missing)
     relevant_nodes = set()
-    visitnodes = map(cl.node, missing)
+    visitnodes = [cl.node(m) for m in  missing]
     required = set(headsrevs) | known
     for rev in visit:
         clrev = cl.changelogrevision(rev)