Mercurial > public > mercurial-scm > hg
comparison mercurial/dispatch.py @ 16279:531e69ff348f
merge with stable
author | Matt Mackall <mpm@selenic.com> |
---|---|
date | Thu, 22 Mar 2012 17:08:05 -0500 |
parents | be92ddc636e3 1c2aaf05f7d7 |
children | ba42eb722bb3 |
comparison
equal
deleted
inserted
replaced
16274:5d75eb8568d1 | 16279:531e69ff348f |
---|---|
223 | 223 |
224 nums = [] | 224 nums = [] |
225 def replacer(m): | 225 def replacer(m): |
226 num = int(m.group(1)) - 1 | 226 num = int(m.group(1)) - 1 |
227 nums.append(num) | 227 nums.append(num) |
228 return givenargs[num] | 228 if num < len(givenargs): |
229 return givenargs[num] | |
230 return '' | |
229 cmd = re.sub(r'\$(\d+|\$)', replacer, cmd) | 231 cmd = re.sub(r'\$(\d+|\$)', replacer, cmd) |
230 givenargs = [x for i, x in enumerate(givenargs) | 232 givenargs = [x for i, x in enumerate(givenargs) |
231 if i not in nums] | 233 if i not in nums] |
232 args = shlex.split(cmd) | 234 args = shlex.split(cmd) |
233 return args + givenargs | 235 return args + givenargs |