Mercurial > hg
comparison hgext/transplant.py @ 38369:365a78daf735
py3: use pycompat.maplist() instead of map() in hgext/transplant.py
map() returns a map-object on Python3 instead of a list.
Differential Revision: https://phab.mercurial-scm.org/D3791
author | Pulkit Goyal <7895pulkit@gmail.com> |
---|---|
date | Mon, 18 Jun 2018 16:06:01 +0530 |
parents | aac4be30e250 |
children | c7eb9bce6041 |
comparison
equal
deleted
inserted
replaced
38368:96ee5276340a | 38369:365a78daf735 |
---|---|
680 raise error.Abort(_('outstanding local changes')) | 680 raise error.Abort(_('outstanding local changes')) |
681 | 681 |
682 sourcerepo = opts.get('source') | 682 sourcerepo = opts.get('source') |
683 if sourcerepo: | 683 if sourcerepo: |
684 peer = hg.peer(repo, opts, ui.expandpath(sourcerepo)) | 684 peer = hg.peer(repo, opts, ui.expandpath(sourcerepo)) |
685 heads = map(peer.lookup, opts.get('branch', ())) | 685 heads = pycompat.maplist(peer.lookup, opts.get('branch', ())) |
686 target = set(heads) | 686 target = set(heads) |
687 for r in revs: | 687 for r in revs: |
688 try: | 688 try: |
689 target.add(peer.lookup(r)) | 689 target.add(peer.lookup(r)) |
690 except error.RepoError: | 690 except error.RepoError: |
691 pass | 691 pass |
692 source, csets, cleanupfn = bundlerepo.getremotechanges(ui, repo, peer, | 692 source, csets, cleanupfn = bundlerepo.getremotechanges(ui, repo, peer, |
693 onlyheads=sorted(target), force=True) | 693 onlyheads=sorted(target), force=True) |
694 else: | 694 else: |
695 source = repo | 695 source = repo |
696 heads = map(source.lookup, opts.get('branch', ())) | 696 heads = pycompat.maplist(source.lookup, opts.get('branch', ())) |
697 cleanupfn = None | 697 cleanupfn = None |
698 | 698 |
699 try: | 699 try: |
700 if opts.get('continue'): | 700 if opts.get('continue'): |
701 tp.resume(repo, source, opts) | 701 tp.resume(repo, source, opts) |
706 prune = set(source[r].node() | 706 prune = set(source[r].node() |
707 for r in scmutil.revrange(source, opts.get('prune'))) | 707 for r in scmutil.revrange(source, opts.get('prune'))) |
708 matchfn = lambda x: tf(x) and x not in prune | 708 matchfn = lambda x: tf(x) and x not in prune |
709 else: | 709 else: |
710 matchfn = tf | 710 matchfn = tf |
711 merges = map(source.lookup, opts.get('merge', ())) | 711 merges = pycompat.maplist(source.lookup, opts.get('merge', ())) |
712 revmap = {} | 712 revmap = {} |
713 if revs: | 713 if revs: |
714 for r in scmutil.revrange(source, revs): | 714 for r in scmutil.revrange(source, revs): |
715 revmap[int(r)] = source[r].node() | 715 revmap[int(r)] = source[r].node() |
716 elif opts.get('all') or not merges: | 716 elif opts.get('all') or not merges: |