Mercurial > hg
changeset 37252:e9ee540af434
scmutil: make revpair() return context objects (API)
Differential Revision: https://phab.mercurial-scm.org/D3006
author | Martin von Zweigbergk <martinvonz@google.com> |
---|---|
date | Sat, 31 Mar 2018 23:10:46 -0700 |
parents | 7c0f40f4f7bf |
children | 6089ef933ab5 |
files | mercurial/scmutil.py |
diffstat | 1 files changed, 5 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/mercurial/scmutil.py Sat Mar 31 23:37:25 2018 -0700 +++ b/mercurial/scmutil.py Sat Mar 31 23:10:46 2018 -0700 @@ -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.