D3051: transplant: avoid repo.lookup() for converting revnum to nodeid

martinvonz (Martin von Zweigbergk) phabricator at mercurial-scm.org
Tue Apr 3 22:09:05 UTC 2018


martinvonz created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D3051

AFFECTED FILES
  hgext/transplant.py

CHANGE DETAILS

diff --git a/hgext/transplant.py b/hgext/transplant.py
--- a/hgext/transplant.py
+++ b/hgext/transplant.py
@@ -703,16 +703,16 @@
 
         tf = tp.transplantfilter(repo, source, p1)
         if opts.get('prune'):
-            prune = set(source.lookup(r)
+            prune = set(source[r].node()
                         for r in scmutil.revrange(source, opts.get('prune')))
             matchfn = lambda x: tf(x) and x not in prune
         else:
             matchfn = tf
         merges = map(source.lookup, opts.get('merge', ()))
         revmap = {}
         if revs:
             for r in scmutil.revrange(source, revs):
-                revmap[int(r)] = source.lookup(r)
+                revmap[int(r)] = source[r].node()
         elif opts.get('all') or not merges:
             if source != repo:
                 alltransplants = incwalk(source, csets, match=matchfn)



To: martinvonz, #hg-reviewers
Cc: mercurial-devel


More information about the Mercurial-devel mailing list