Patchwork D3007: extdiff: use context-returning revpair()

login
register
mail settings
Submitter phabricator
Date April 1, 2018, 7:11 a.m.
Message ID <differential-rev-PHID-DREV-moxklzavorkmen43tdqv-req@phab.mercurial-scm.org>
Download mbox | patch
Permalink /patch/30101/
State Superseded
Headers show

Comments

phabricator - April 1, 2018, 7:11 a.m.
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/D3007

AFFECTED FILES
  hgext/extdiff.py

CHANGE DETAILS




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

Patch

diff --git a/hgext/extdiff.py b/hgext/extdiff.py
--- a/hgext/extdiff.py
+++ b/hgext/extdiff.py
@@ -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: