Patchwork D3006: scmutil: make revpair() return context objects (API)

login
register
mail settings
Submitter phabricator
Date April 1, 2018, 10:37 a.m.
Message ID <5fcf9ad61be297482d0f5f0720b85f92@localhost.localdomain>
Download mbox | patch
Permalink /patch/30108/
State Not Applicable
Headers show

Comments

phabricator - April 1, 2018, 10:37 a.m.
This revision was automatically updated to reflect the committed changes.
Closed by commit rHGe9ee540af434: scmutil: make revpair() return context objects (API) (authored by martinvonz, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D3006?vs=7486&id=7494

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

AFFECTED FILES
  mercurial/scmutil.py

CHANGE DETAILS




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

Patch

diff --git a/mercurial/scmutil.py b/mercurial/scmutil.py
--- a/mercurial/scmutil.py
+++ b/mercurial/scmutil.py
@@ -447,11 +447,12 @@ 
     return tree and tree[0] in ('range', 'rangepre', 'rangepost', 'rangeall')
 
 def revpairnodes(repo, revs):
-    return revpair(repo, revs)
+    ctx1, ctx2 = revpair(repo, revs)
+    return ctx1.node(), ctx2.node()
 
 def revpair(repo, revs):
     if not revs:
-        return repo.dirstate.p1(), None
+        return repo['.'], repo[None]
 
     l = revrange(repo, revs)
 
@@ -475,9 +476,9 @@ 
 
     # if top-level is range expression, the result must always be a pair
     if first == second and len(revs) == 1 and not _pairspec(revs[0]):
-        return repo.lookup(first), None
+        return repo[first], repo[None]
 
-    return repo.lookup(first), repo.lookup(second)
+    return repo[first], repo[second]
 
 def revrange(repo, specs, localalias=None):
     """Execute 1 to many revsets and return the union.