Mercurial > hg
comparison hgext/transplant.py @ 37311:2a8939e25d07
transplant: avoid repo.lookup() for converting revnum to nodeid
Differential Revision: https://phab.mercurial-scm.org/D3051
author | Martin von Zweigbergk <martinvonz@google.com> |
---|---|
date | Sun, 01 Apr 2018 23:19:37 -0700 |
parents | a8a902d7176e |
children | aac4be30e250 |
comparison
equal
deleted
inserted
replaced
37310:5da299dabdc1 | 37311:2a8939e25d07 |
---|---|
701 tp.resume(repo, source, opts) | 701 tp.resume(repo, source, opts) |
702 return | 702 return |
703 | 703 |
704 tf = tp.transplantfilter(repo, source, p1) | 704 tf = tp.transplantfilter(repo, source, p1) |
705 if opts.get('prune'): | 705 if opts.get('prune'): |
706 prune = set(source.lookup(r) | 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 = map(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.lookup(r) | 715 revmap[int(r)] = source[r].node() |
716 elif opts.get('all') or not merges: | 716 elif opts.get('all') or not merges: |
717 if source != repo: | 717 if source != repo: |
718 alltransplants = incwalk(source, csets, match=matchfn) | 718 alltransplants = incwalk(source, csets, match=matchfn) |
719 else: | 719 else: |
720 alltransplants = transplantwalk(source, p1, heads, | 720 alltransplants = transplantwalk(source, p1, heads, |