@@ -23,6 +23,7 @@
filemerge,
fileset,
minirst,
+ pycompat,
revset,
templatefilters,
templatekw,
@@ -129,7 +130,7 @@
}
for names, header, doc in helptable:
# Old extensions may use a str as doc.
- if (sum(map(lowercontains, names))
+ if (sum(pycompat.maplist(lowercontains, names))
or lowercontains(header)
or (callable(doc) and lowercontains(doc(ui)))):
results['topics'].append((names[0], header))
@@ -20,6 +20,7 @@
from . import (
encoding,
error,
+ pycompat,
sslutil,
util,
)
@@ -157,7 +158,7 @@
'''send mail using sendmail.'''
program = ui.config('email', 'method', 'smtp')
cmdline = '%s -f %s %s' % (program, util.email(sender),
- ' '.join(map(util.email, recipients)))
+ ' '.join(pycompat.maplist(util.email, recipients)))
ui.note(_('sending mail: %s\n') % cmdline)
fp = util.popen(cmdline, 'w')
fp.write(msg)
@@ -463,7 +463,7 @@
'warning': _('Warning!')}
def formatoption(block, width):
- desc = ' '.join(map(str.strip, block['lines']))
+ desc = ' '.join(pycompat.maplist(str.strip, block['lines']))
colwidth = encoding.colwidth(block['optstr'])
usablewidth = width - 1
hanging = block['optstrwidth']
@@ -485,7 +485,7 @@
hang = len(block['lines'][-1]) - len(block['lines'][-1].lstrip())
defindent = indent + hang * ' '
- text = ' '.join(map(str.strip, block['lines']))
+ text = ' '.join(pycompat.maplist(str.strip, block['lines']))
return '%s\n%s\n' % (indent + admonition,
util.wrap(text, width=width,
initindent=defindent,
@@ -523,7 +523,7 @@
term = indent + block['lines'][0]
hang = len(block['lines'][-1]) - len(block['lines'][-1].lstrip())
defindent = indent + hang * ' '
- text = ' '.join(map(str.strip, block['lines'][1:]))
+ text = ' '.join(pycompat.maplist(str.strip, block['lines'][1:]))
return '%s\n%s\n' % (term, util.wrap(text, width=width,
initindent=defindent,
hangindent=defindent))
@@ -549,7 +549,7 @@
elif block['type'] == 'option':
return formatoption(block, width)
- text = ' '.join(map(bytes.strip, block['lines']))
+ text = ' '.join(pycompat.maplist(bytes.strip, block['lines']))
return util.wrap(text, width=width,
initindent=indent,
hangindent=subindent) + '\n'
@@ -578,7 +578,7 @@
if btype == 'admonition':
admonition = escape(_admonitiontitles[b['admonitiontitle']])
- text = escape(' '.join(map(str.strip, lines)))
+ text = escape(' '.join(pycompat.maplist(str.strip, lines)))
out.append('<p>\n<b>%s</b> %s\n</p>\n' % (admonition, text))
elif btype == 'paragraph':
out.append('<p>\n%s\n</p>\n' % escape('\n'.join(lines)))
@@ -608,7 +608,7 @@
elif btype == 'definition':
openlist('dl', level)
term = escape(lines[0])
- text = escape(' '.join(map(str.strip, lines[1:])))
+ text = escape(' '.join(pycompat.maplist(str.strip, lines[1:])))
out.append(' <dt>%s\n <dd>%s\n' % (term, text))
elif btype == 'bullet':
bullet, head = lines[0].split(' ', 1)
@@ -620,12 +620,12 @@
elif btype == 'field':
openlist('dl', level)
key = escape(b['key'])
- text = escape(' '.join(map(str.strip, lines)))
+ text = escape(' '.join(pycompat.maplist(str.strip, lines)))
out.append(' <dt>%s\n <dd>%s\n' % (key, text))
elif btype == 'option':
openlist('dl', level)
opt = escape(b['optstr'])
- desc = escape(' '.join(map(str.strip, lines)))
+ desc = escape(' '.join(pycompat.maplist(str.strip, lines)))
out.append(' <dt>%s\n <dd>%s\n' % (opt, desc))
# close lists if indent level of next block is lower
@@ -114,6 +114,7 @@
)
from . import (
error,
+ pycompat,
smartset,
txnutil,
)
@@ -204,7 +205,8 @@
repo = repo.unfiltered()
nativeroots = []
for phase in trackedphases:
- nativeroots.append(map(repo.changelog.rev, self.phaseroots[phase]))
+ nativeroots.append(pycompat.maplist(repo.changelog.rev,
+ self.phaseroots[phase]))
return repo.changelog.computephases(nativeroots)
def _computephaserevspure(self, repo):
@@ -213,7 +215,7 @@
self._phaserevs = revs
self._populatephaseroots(repo)
for phase in trackedphases:
- roots = list(map(repo.changelog.rev, self.phaseroots[phase]))
+ roots = pycompat.maplist(repo.changelog.rev, self.phaseroots[phase])
if roots:
for rev in roots:
revs[rev] = phase
@@ -259,7 +259,7 @@
def _registeraliases(self, origin, items):
"""Add items that will be populated at the first access"""
- items = map(sysstr, items)
+ items = maplist(sysstr, items)
self._aliases.update(
(item.replace(sysstr('_'), sysstr('')).lower(), (origin, item))
for item in items)