py3: introduce pycompat.ziplist as zip is a generator on Python 3
Similar to map, the return value of zip was also turned into a generator on
Python 3. We have multiple occurences in our codebase where we retrieve the
values of zip multiple times, so let's introduce pycompat.ziplist similar to
pycompat.maplist.
Differential Revision: https://phab.mercurial-scm.org/D1675
--- a/mercurial/pycompat.py Mon Dec 11 05:26:46 2017 +0530
+++ b/mercurial/pycompat.py Mon Dec 11 05:56:35 2017 +0530
@@ -63,6 +63,7 @@
sysexecutable = os.fsencode(sysexecutable)
stringio = io.BytesIO
maplist = lambda *args: list(map(*args))
+ ziplist = lambda *args: list(zip(*args))
rawinput = input
# TODO: .buffer might not exist if std streams were replaced; we'll need
@@ -313,6 +314,7 @@
shlexsplit = shlex.split
stringio = cStringIO.StringIO
maplist = map
+ ziplist = zip
rawinput = raw_input
isjython = sysplatform.startswith('java')