py3: fix test-parse-date.t
authorMark Thomas <mbthomas@fb.com>
Sat, 13 Oct 2018 13:39:07 +0000
changeset 40256 d4d2c567bb72
parent 40255 4f1f024353ae
child 40257 c3970be8deca
py3: fix test-parse-date.t Differential Revision: https://phab.mercurial-scm.org/D5084
contrib/python3-whitelist
mercurial/utils/dateutil.py
--- a/contrib/python3-whitelist	Fri Oct 12 16:51:11 2018 +0200
+++ b/contrib/python3-whitelist	Sat Oct 13 13:39:07 2018 +0000
@@ -405,6 +405,7 @@
 test-pager-legacy.t
 test-pager.t
 test-parents.t
+test-parse-date.t
 test-parseindex2.py
 test-patch-offset.t
 test-patch.t
--- a/mercurial/utils/dateutil.py	Fri Oct 12 16:51:11 2018 +0200
+++ b/mercurial/utils/dateutil.py	Sat Oct 13 13:39:07 2018 +0000
@@ -303,17 +303,17 @@
 
     if not date:
         raise error.Abort(_("dates cannot consist entirely of whitespace"))
-    elif date[0] == "<":
+    elif date[0:1] == b"<":
         if not date[1:]:
             raise error.Abort(_("invalid day spec, use '<DATE'"))
         when = upper(date[1:])
         return lambda x: x <= when
-    elif date[0] == ">":
+    elif date[0:1] == b">":
         if not date[1:]:
             raise error.Abort(_("invalid day spec, use '>DATE'"))
         when = lower(date[1:])
         return lambda x: x >= when
-    elif date[0] == "-":
+    elif date[0:1] == b"-":
         try:
             days = int(date[1:])
         except ValueError:
@@ -323,8 +323,8 @@
                 % date[1:])
         when = makedate()[0] - days * 3600 * 24
         return lambda x: x >= when
-    elif " to " in date:
-        a, b = date.split(" to ")
+    elif b" to " in date:
+        a, b = date.split(b" to ")
         start, stop = lower(a), upper(b)
         return lambda x: x >= start and x <= stop
     else: