Patchwork D1790: py3: use pycompat.ziplist instead of inbuilt zip

login
register
mail settings
Submitter phabricator
Date Dec. 29, 2017, 12:48 a.m.
Message ID <differential-rev-PHID-DREV-kgcu5de5lkiqfamiv4tr-req@phab.mercurial-scm.org>
Download mbox | patch
Permalink /patch/26488/
State Superseded
Headers show

Comments

phabricator - Dec. 29, 2017, 12:48 a.m.
pulkit created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  zip just like map on Python 3 returns a generator object instead of list. This
  results in error if we try to iterate over the result once we consume it. We
  have added pycompat.ziplist which returns a list.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  mercurial/context.py

CHANGE DETAILS




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

Patch

diff --git a/mercurial/context.py b/mercurial/context.py
--- a/mercurial/context.py
+++ b/mercurial/context.py
@@ -1108,7 +1108,7 @@ 
                 hist[f] = curr
                 del pcache[f]
 
-        return zip(hist[base][0], hist[base][1].splitlines(True))
+        return pycompat.ziplist(hist[base][0], hist[base][1].splitlines(True))
 
     def ancestors(self, followfirst=False):
         visit = {}