py3: use pycompat.bytestr instead of bytes
authorPulkit Goyal <7895pulkit@gmail.com>
Fri, 05 May 2017 01:26:49 +0530
changeset 32203 52e222eef646
parent 32202 6f173560c7f4
child 32204 055cca8e167b
py3: use pycompat.bytestr instead of bytes
mercurial/templater.py
mercurial/util.py
--- a/mercurial/templater.py	Fri May 05 01:26:13 2017 +0530
+++ b/mercurial/templater.py	Fri May 05 01:26:49 2017 +0530
@@ -53,6 +53,7 @@
     """Parse a template expression into a stream of tokens, which must end
     with term if specified"""
     pos = start
+    program = pycompat.bytestr(program)
     while pos < end:
         c = program[pos]
         if c.isspace(): # skip inter-token whitespace
--- a/mercurial/util.py	Fri May 05 01:26:13 2017 +0530
+++ b/mercurial/util.py	Fri May 05 01:26:49 2017 +0530
@@ -1913,6 +1913,7 @@
     # add missing elements from defaults
     usenow = False # default to using biased defaults
     for part in ("S", "M", "HI", "d", "mb", "yY"): # decreasing specificity
+        part = pycompat.bytestr(part)
         found = [True for p in part if ("%"+p) in format]
         if not found:
             date += "@" + defaults[part][usenow]