diff mercurial/revset.py @ 20863:876c17336b4e

revset: raise ValueError when calling min or max on empty smartset min([]) raise a ValueError, we do the same thing in smartset.min() and smartset.max() for the sake of consistency. The min/amax test are greatly improved in the process to prevent this familly of regression
author Pierre-Yves David <pierre-yves.david@fb.com>
date Fri, 28 Mar 2014 17:00:13 -0700
parents bc95143446e8
children 04e1596d5dbd
line wrap: on
line diff
--- a/mercurial/revset.py	Thu Mar 20 18:44:25 2014 -0700
+++ b/mercurial/revset.py	Fri Mar 28 17:00:13 2014 -0700
@@ -2287,7 +2287,7 @@
         """return the first revision in the set"""
         for r in self:
             return r
-        return None
+        raise ValueError('arg is an empty sequence')
 
     def _last(self):
         """return the last revision in the set"""