@@ -26,6 +26,7 @@
obsolete,
phases,
pushkey,
+ pycompat,
scmutil,
sslutil,
streamclone,
@@ -609,7 +610,7 @@
ui.debug("checking for updated bookmarks\n")
ancestors = ()
if pushop.revs:
- revnums = map(repo.changelog.rev, pushop.revs)
+ revnums = pycompat.maplist(repo.changelog.rev, pushop.revs)
ancestors = repo.changelog.ancestors(revnums, inclusive=True)
remotebookmark = remote.listkeys('bookmarks')
@@ -19,6 +19,7 @@
)
from . import (
error,
+ pycompat,
)
def bisect(changelog, state):
@@ -202,7 +203,7 @@
"""
state = load_state(repo)
if status in ('good', 'bad', 'skip', 'current'):
- return map(repo.changelog.rev, state[status])
+ return pycompat.maplist(repo.changelog.rev, state[status])
else:
# In the following sets, we do *not* call 'bisect()' with more
# than one level of recursion, because that can be very, very
@@ -100,7 +100,7 @@
'''
e = '_'
xchr = pycompat.bytechr
- asciistr = list(map(xchr, range(127)))
+ asciistr = pycompat.maplist(xchr, range(127))
capitals = list(range(ord("A"), ord("Z") + 1))
cmap = dict((x, x) for x in asciistr)
@@ -13,6 +13,7 @@
from . import (
branchmap,
error,
+ pycompat,
store,
util,
)
@@ -131,7 +132,7 @@
l = fp.readline()
try:
- filecount, bytecount = map(int, l.split(' ', 1))
+ filecount, bytecount = pycompat.maplist(int, l.split(' ', 1))
except (ValueError, TypeError):
raise error.ResponseError(
_('unexpected response from remote server:'), l)
@@ -1936,7 +1936,7 @@
datetime.timedelta(days=1)).strftime('%b %d')
try:
- when, offset = map(int, date.split(' '))
+ when, offset = pycompat.maplist(int, date.split(' '))
except ValueError:
# fill out defaults
now = makedate()
@@ -3384,7 +3384,7 @@
pos = pos2
parts.append(z.flush())
- if sum(map(len, parts)) < insize:
+ if sum(pycompat.maplist(len, parts)) < insize:
return ''.join(parts)
return None
@@ -3569,7 +3569,7 @@
pos = pos2
chunks.append(z.flush())
- if sum(map(len, chunks)) < insize:
+ if sum(pycompat.maplist(len, chunks)) < insize:
return ''.join(chunks)
return None
@@ -17,6 +17,7 @@
from . import (
error,
+ pycompat,
revlog,
scmutil,
util,
@@ -103,7 +104,8 @@
if self.lrugetctx(l)[f].filenode() == node]
except Exception:
pass
- self.warn(_(" (expected %s)") % " ".join(map(str, linkrevs)))
+ self.warn(_(" (expected %s)") % " ".join(pycompat.maplist(str,
+ linkrevs)))
lr = None # can't be trusted
try:
@@ -157,12 +157,12 @@
def decodelist(l, sep=' '):
if l:
- return map(bin, l.split(sep))
+ return pycompat.maplist(bin, l.split(sep))
return []
def encodelist(l, sep=' '):
try:
- return sep.join(map(hex, l))
+ return sep.join(pycompat.maplist(hex, l))
except TypeError:
raise