mercurial/dispatch.py
branchstable
changeset 16277 1c2aaf05f7d7
parent 15781 cc2da4a5ed9a
child 16279 531e69ff348f
child 16294 795d591b6ef5
--- a/mercurial/dispatch.py	Wed Mar 21 16:39:38 2012 -0500
+++ b/mercurial/dispatch.py	Thu Mar 22 17:07:39 2012 -0500
@@ -225,7 +225,9 @@
         def replacer(m):
             num = int(m.group(1)) - 1
             nums.append(num)
-            return givenargs[num]
+            if num < len(givenargs):
+                return givenargs[num]
+            return ''
         cmd = re.sub(r'\$(\d+|\$)', replacer, cmd)
         givenargs = [x for i, x in enumerate(givenargs)
                      if i not in nums]