D5688: revpair: clarify check for empty revset

martinvonz (Martin von Zweigbergk) phabricator at mercurial-scm.org
Fri Jan 25 15:04:22 EST 2019


This revision was automatically updated to reflect the committed changes.
Closed by commit rHGd055f89c8b5b: revpair: clarify check for empty revset (authored by martinvonz, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D5688?vs=13430&id=13458

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