mercurial/revsetlang.py
changeset 35593 850cd045b1df
parent 35592 0fd617afebc0
child 35594 468d7a1f6633
--- a/mercurial/revsetlang.py	Sat Apr 01 17:25:45 2017 +0900
+++ b/mercurial/revsetlang.py	Sat Apr 01 17:28:28 2017 +0900
@@ -631,7 +631,10 @@
             break
         ret.append(expr[pos:q])
         pos = q + 1
-        d = expr[pos]
+        try:
+            d = expr[pos]
+        except IndexError:
+            raise error.ParseError(_('incomplete revspec format character'))
         if d == '%':
             ret.append(d)
             pos += 1
@@ -644,7 +647,10 @@
         if d == 'l':
             # a list of some type
             pos += 1
-            d = expr[pos]
+            try:
+                d = expr[pos]
+            except IndexError:
+                raise error.ParseError(_('incomplete revspec format character'))
             ret.append(listexp(list(arg), d))
         else:
             ret.append(argtype(d, arg))