D5688: revpair: clarify check for empty revset
martinvonz (Martin von Zweigbergk)
phabricator at mercurial-scm.org
Thu Jan 24 20:51:26 UTC 2019
martinvonz created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.
REPOSITORY
rHG Mercurial
REVISION DETAIL
https://phab.mercurial-scm.org/D5688
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,11 +672,12 @@
l = revrange(repo, revs)
+ if not l:
+ raise error.Abort(_('empty revision range'))
+
first = l.first()
second = l.last()
- if first is None:
- raise error.Abort(_('empty revision range'))
if (first == second and len(revs) >= 2
and not all(revrange(repo, [r]) for r in revs)):
raise error.Abort(_('empty revision on one side of range'))
To: martinvonz, #hg-reviewers
Cc: mercurial-devel
More information about the Mercurial-devel
mailing list