comparison mercurial/obsutil.py @ 34873:aa849cf5d089

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.
author Boris Feld <boris.feld@octobus.net>
date Wed, 18 Oct 2017 15:38:51 +0200
parents 6f53a53245a2
children b81ad5b78a81
comparison
equal deleted inserted replaced
34872:29f52e7966dd 34873:aa849cf5d089
820 line.append(" by %s" % ", ".join(users)) 820 line.append(" by %s" % ", ".join(users))
821 821
822 # Date 822 # Date
823 dates = markersdates(markers) 823 dates = markersdates(markers)
824 824
825 if verbose: 825 if dates and verbose:
826 min_date = min(dates) 826 min_date = min(dates)
827 max_date = max(dates) 827 max_date = max(dates)
828 828
829 if min_date == max_date: 829 if min_date == max_date:
830 fmtmin_date = util.datestr(min_date, '%Y-%m-%d %H:%M %1%2') 830 fmtmin_date = util.datestr(min_date, '%Y-%m-%d %H:%M %1%2')