diff mercurial/templater.py @ 18884:0615b22da148

template: allow unquoted int function arguments
author Brendan Cully <brendan@kublai.com>
date Sun, 07 Apr 2013 23:25:50 -0700
parents f5db3092790f
children 8c64c4af21a4
line wrap: on
line diff
--- a/mercurial/templater.py	Mon Apr 08 09:44:26 2013 -0700
+++ b/mercurial/templater.py	Sun Apr 07 23:25:50 2013 -0700
@@ -66,7 +66,10 @@
                     break
                 pos += 1
             sym = program[s:pos]
-            yield ('symbol', sym, s)
+            try:
+                yield('string', str(int(sym)), s)
+            except ValueError:
+                yield ('symbol', sym, s)
             pos -= 1
         elif c == '}':
             pos += 1