comparison mercurial/commands.py @ 35867:56891a790012

commands: replace map() with list comprehension This will work identically on Python 2 and 3. Differential Revision: https://phab.mercurial-scm.org/D1886
author Augie Fackler <augie@google.com>
date Wed, 17 Jan 2018 20:08:40 -0500
parents 555bc4ab37ad
children 1bf5263fe5cc
comparison
equal deleted inserted replaced
35866:555bc4ab37ad 35867:56891a790012
1217 if base: 1217 if base:
1218 if dest: 1218 if dest:
1219 raise error.Abort(_("--base is incompatible with specifying " 1219 raise error.Abort(_("--base is incompatible with specifying "
1220 "a destination")) 1220 "a destination"))
1221 common = [repo.lookup(rev) for rev in base] 1221 common = [repo.lookup(rev) for rev in base]
1222 heads = map(repo.lookup, revs) if revs else None 1222 heads = [repo.lookup(r) for r in revs] if revs else None
1223 outgoing = discovery.outgoing(repo, common, heads) 1223 outgoing = discovery.outgoing(repo, common, heads)
1224 else: 1224 else:
1225 dest = ui.expandpath(dest or 'default-push', dest or 'default') 1225 dest = ui.expandpath(dest or 'default-push', dest or 'default')
1226 dest, branches = hg.parseurl(dest, opts.get('branch')) 1226 dest, branches = hg.parseurl(dest, opts.get('branch'))
1227 other = hg.peer(repo, opts, dest) 1227 other = hg.peer(repo, opts, dest)