changeset 31404:7409eb69731f

util: make strdate's defaults default value a dict It was specified to be an empty list in c6adf2be6069 in 2007. It was correct at the time. But when the function was refactored in 91bc001a592f (2010), it started expecting a dict. I guess this code path is untested? Thanks to Yuya for spotting this.
author Gregory Szorc <gregory.szorc@gmail.com>
date Tue, 14 Mar 2017 08:51:35 -0700
parents 10c17f8bfcf3
children d5eb20934c36
files mercurial/util.py
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/util.py	Wed Mar 15 14:51:18 2017 +0530
+++ b/mercurial/util.py	Tue Mar 14 08:51:35 2017 -0700
@@ -1830,7 +1830,7 @@
 def strdate(string, format, defaults=None):
     """parse a localized time string and return a (unixtime, offset) tuple.
     if the string cannot be parsed, ValueError is raised."""
-    defaults = defaults or []
+    defaults = defaults or {}
 
     # NOTE: unixtime = localunixtime + offset
     offset, date = parsetimezone(string)