comparison mercurial/scmutil.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 a8a902d7176e
children e9ee540af434
comparison
equal deleted inserted replaced
37250:9640ccf44ac0 37251:7c0f40f4f7bf
444 444
445 def _pairspec(revspec): 445 def _pairspec(revspec):
446 tree = revsetlang.parse(revspec) 446 tree = revsetlang.parse(revspec)
447 return tree and tree[0] in ('range', 'rangepre', 'rangepost', 'rangeall') 447 return tree and tree[0] in ('range', 'rangepre', 'rangepost', 'rangeall')
448 448
449 def revpairnodes(repo, revs):
450 return revpair(repo, revs)
451
449 def revpair(repo, revs): 452 def revpair(repo, revs):
450 if not revs: 453 if not revs:
451 return repo.dirstate.p1(), None 454 return repo.dirstate.p1(), None
452 455
453 l = revrange(repo, revs) 456 l = revrange(repo, revs)