##// END OF EJS Templates
scmutil: make revpair() return context objects (API)...
Martin von Zweigbergk -
r37269:e9ee540a default
parent child Browse files
Show More
@@ -447,11 +447,12 def _pairspec(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):
449 def revpairnodes(repo, revs):
450 return revpair(repo, revs)
450 ctx1, ctx2 = revpair(repo, revs)
451 return ctx1.node(), ctx2.node()
451
452
452 def revpair(repo, revs):
453 def revpair(repo, revs):
453 if not revs:
454 if not revs:
454 return repo.dirstate.p1(), None
455 return repo['.'], repo[None]
455
456
456 l = revrange(repo, revs)
457 l = revrange(repo, revs)
457
458
@@ -475,9 +476,9 def revpair(repo, revs):
475
476
476 # if top-level is range expression, the result must always be a pair
477 # if top-level is range expression, the result must always be a pair
477 if first == second and len(revs) == 1 and not _pairspec(revs[0]):
478 if first == second and len(revs) == 1 and not _pairspec(revs[0]):
478 return repo.lookup(first), None
479 return repo[first], repo[None]
479
480
480 return repo.lookup(first), repo.lookup(second)
481 return repo[first], repo[second]
481
482
482 def revrange(repo, specs, localalias=None):
483 def revrange(repo, specs, localalias=None):
483 """Execute 1 to many revsets and return the union.
484 """Execute 1 to many revsets and return the union.
General Comments 0
You need to be logged in to leave comments. Login now