mercurial/templater.py
changeset 26504 875e5d89dc86
parent 26485 43bf9471fae9
parent 26502 4ca98a389152
child 26564 bed9e6c706f6
--- a/mercurial/templater.py	Fri Oct 02 13:00:47 2015 -0700
+++ b/mercurial/templater.py	Wed Oct 07 13:44:48 2015 -0500
@@ -713,7 +713,7 @@
         splitter = None
 
     tokens = text.split(splitter)
-    if num >= len(tokens):
+    if num >= len(tokens) or num < -len(tokens):
         return ''
     else:
         return tokens[num]