changeset 37255:6089ef933ab5

extdiff: use context-returning revpair() Differential Revision: https://phab.mercurial-scm.org/D3007
author Martin von Zweigbergk <martinvonz@google.com>
date Sat, 31 Mar 2018 23:38:53 -0700
parents e9ee540af434
children ddf50e82e21a
files hgext/extdiff.py
diffstat 1 files changed, 9 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/hgext/extdiff.py	Sat Mar 31 23:10:46 2018 -0700
+++ b/hgext/extdiff.py	Sat Mar 31 23:38:53 2018 -0700
@@ -168,14 +168,18 @@
         msg = _('cannot specify --rev and --change at the same time')
         raise error.Abort(msg)
     elif change:
-        node2 = scmutil.revsingle(repo, change, None).node()
-        node1a, node1b = repo.changelog.parents(node2)
+        ctx2 = scmutil.revsingle(repo, change, None)
+        ctx1a, ctx1b = ctx2.p1(), ctx2.p2()
     else:
-        node1a, node2 = scmutil.revpairnodes(repo, revs)
+        ctx1a, ctx2 = scmutil.revpair(repo, revs)
         if not revs:
-            node1b = repo.dirstate.p2()
+            ctx1b = repo[None].p2()
         else:
-            node1b = nullid
+            ctx1b = repo[nullid]
+
+    node1a = ctx1a.node()
+    node1b = ctx1b.node()
+    node2 = ctx2.node()
 
     # Disable 3-way merge if there is only one parent
     if do3way: