diff mercurial/commands.py @ 37251:7c0f40f4f7bf

scmutil: introduce deprecated alias for revpair() revsingle() returns a context object, revpair() returns nodeids, revrange() returns integer revisions (in a revset). I'm going to reduce this inconsistency by making revpair() return context objects. Changing the return type is not nice to extensions, so this patch introduces a nodeid-returning version of revpair() that they can detect and use. Update callers to the new function so we can change revpair() itself and then migrate them back one by one. Differential Revision: https://phab.mercurial-scm.org/D3005
author Martin von Zweigbergk <martinvonz@google.com>
date Sat, 31 Mar 2018 23:37:25 -0700
parents 6c7a6b04b274
children ddf50e82e21a
line wrap: on
line diff
--- a/mercurial/commands.py	Sat Mar 31 23:58:08 2018 -0400
+++ b/mercurial/commands.py	Sat Mar 31 23:37:25 2018 -0700
@@ -1878,7 +1878,7 @@
         node1 = repo[node2].p1().node()
     else:
         repo = scmutil.unhidehashlikerevs(repo, revs, 'nowarn')
-        node1, node2 = scmutil.revpair(repo, revs)
+        node1, node2 = scmutil.revpairnodes(repo, revs)
 
     if reverse:
         node1, node2 = node2, node1
@@ -4880,7 +4880,7 @@
         node1 = repo[node2].p1().node()
     else:
         repo = scmutil.unhidehashlikerevs(repo, revs, 'nowarn')
-        node1, node2 = scmutil.revpair(repo, revs)
+        node1, node2 = scmutil.revpairnodes(repo, revs)
 
     if pats or ui.configbool('commands', 'status.relative'):
         cwd = repo.getcwd()