D5687: revpair: simplify revpair by always relying on smartset.first/last
martinvonz (Martin von Zweigbergk)
phabricator at mercurial-scm.org
Fri Jan 25 15:03:50 EST 2019
This revision was automatically updated to reflect the committed changes.
Closed by commit rHG90636f6a2022: revpair: simplify revpair by always relying on smartset.first/last (authored by martinvonz, committed by ).
REPOSITORY
rHG Mercurial
CHANGES SINCE LAST UPDATE
https://phab.mercurial-scm.org/D5687?vs=13429&id=13457
REVISION DETAIL
https://phab.mercurial-scm.org/D5687
AFFECTED FILES
mercurial/scmutil.py
CHANGE DETAILS
diff --git a/mercurial/scmutil.py b/mercurial/scmutil.py
--- a/mercurial/scmutil.py
+++ b/mercurial/scmutil.py
@@ -672,17 +672,8 @@
l = revrange(repo, revs)
- if not l:
- first = second = None
- elif l.isascending():
- first = l.min()
- second = l.max()
- elif l.isdescending():
- first = l.max()
- second = l.min()
- else:
- first = l.first()
- second = l.last()
+ first = l.first()
+ second = l.last()
if first is None:
raise error.Abort(_('empty revision range'))
To: martinvonz, #hg-reviewers
Cc: mercurial-devel
More information about the Mercurial-devel
mailing list