mercurial/templater.py
changeset 20539 aa021ece4506
parent 20519 cda9d2b6beab
child 20670 0084fcd5d7e2
--- a/mercurial/templater.py	Fri Feb 21 13:16:17 2014 -0800
+++ b/mercurial/templater.py	Thu Feb 20 00:46:13 2014 -0600
@@ -416,7 +416,12 @@
                     return False
 
             try:
-                int(test)
+                i = int(test)
+                # if we are a pure int, then starting with zero will not be
+                # confused as a rev; or, obviously, if the int is larger than
+                # the value of the tip rev
+                if test[0] == '0' or i > len(cl):
+                    return True
                 return False
             except ValueError:
                 return True