obsfate: fix obsfate_printer with empty date list
authorBoris Feld <boris.feld@octobus.net>
Wed, 18 Oct 2017 15:38:51 +0200
changeset 34873 aa849cf5d089
parent 34872 29f52e7966dd
child 34874 e3fbf8e3fef2
obsfate: fix obsfate_printer with empty date list When the list of dates is empty, `min` and `max` would raises a ValueError. Protect against this case by checking that the date list is not empty. I didn't add a test because I couldn't find a reproducing test case.
mercurial/obsutil.py
--- a/mercurial/obsutil.py	Tue Oct 17 16:54:31 2017 +0200
+++ b/mercurial/obsutil.py	Wed Oct 18 15:38:51 2017 +0200
@@ -822,7 +822,7 @@
     # Date
     dates = markersdates(markers)
 
-    if verbose:
+    if dates and verbose:
         min_date = min(dates)
         max_date = max(dates)