diff mercurial/templater.py @ 29636:84ef4517de03 stable

date: refactor timezone parsing We want to be able to accept ISO 8601 style timezones that don't include a space separator, so we change the timezone parsing function to accept a full date string and return both the offset and the non-timezone portion.
author Matt Mackall <mpm@selenic.com>
date Wed, 27 Jul 2016 15:14:19 -0500
parents df838803c1d4
children 01f036f0e40b
line wrap: on
line diff
--- a/mercurial/templater.py	Thu Jul 28 08:53:36 2016 -0700
+++ b/mercurial/templater.py	Wed Jul 27 15:14:19 2016 -0500
@@ -670,7 +670,9 @@
         tzoffset = None
         tz = evalfuncarg(context, mapping, args[1])
         if isinstance(tz, str):
-            tzoffset = util.parsetimezone(tz)
+            tzoffset, remainder = util.parsetimezone(tz)
+            if remainder:
+                tzoffset = None
         if tzoffset is None:
             try:
                 tzoffset = int(tz)