# HG changeset patch # User Martin von Zweigbergk # Date 1522791561 25200 # Node ID 4d69668a65d82f832951718da78af6c7ee4770a0 # Parent 6942c73f0733419929fc687d21fd6896272fbf09 push: avoid using repo.lookup() for converting to nodeid repo.lookup(x) currently simply does repo[x].node(), which supports various types of inputs. As I explained in 0194dac77c93 (scmutil: add method for looking up a context given a revision symbol, 2018-04-02), I'd like to split that up so we use the new scmutil.revsymbol() for string inputs repo[x] for integer revnums and binary nodeids. Since repo.lookup() seems to exist in order to serve peer.lookup(), I think it should be calling revsymbol. However, we have several callers that use repo.lookup() with something that's not a string, so we need to remove those first. This patch starts doing that. Many more will follow. Differential Revision: https://phab.mercurial-scm.org/D3047 diff -r 6942c73f0733 -r 4d69668a65d8 mercurial/commands.py --- a/mercurial/commands.py Tue Apr 03 22:24:50 2018 +0900 +++ b/mercurial/commands.py Tue Apr 03 14:39:21 2018 -0700 @@ -4148,7 +4148,7 @@ other = hg.peer(repo, opts, dest) if revs: - revs = [repo.lookup(r) for r in scmutil.revrange(repo, revs)] + revs = [repo[r].node() for r in scmutil.revrange(repo, revs)] if not revs: raise error.Abort(_("specified revisions evaluate to an empty set"), hint=_("use different revision arguments"))