mercurial/templater.py
branchstable
changeset 26502 4ca98a389152
parent 25815 e71e5629e006
child 26504 875e5d89dc86
child 26535 d3712209921d
--- a/mercurial/templater.py	Thu Oct 01 12:07:20 2015 -0500
+++ b/mercurial/templater.py	Mon Oct 05 12:37:26 2015 -0400
@@ -649,7 +649,7 @@
         splitter = None
 
     tokens = text.split(splitter)
-    if num >= len(tokens):
+    if num >= len(tokens) or num < -len(tokens):
         return ''
     else:
         return tokens[num]