equal
deleted
inserted
replaced
508 def replacer(m): |
508 def replacer(m): |
509 num = int(m.group(1)) - 1 |
509 num = int(m.group(1)) - 1 |
510 nums.append(num) |
510 nums.append(num) |
511 if num < len(givenargs): |
511 if num < len(givenargs): |
512 return givenargs[num] |
512 return givenargs[num] |
513 raise error.Abort(_(b'too few arguments for command alias')) |
513 raise error.InputError(_(b'too few arguments for command alias')) |
514 |
514 |
515 cmd = re.sub(br'\$(\d+|\$)', replacer, cmd) |
515 cmd = re.sub(br'\$(\d+|\$)', replacer, cmd) |
516 givenargs = [x for i, x in enumerate(givenargs) if i not in nums] |
516 givenargs = [x for i, x in enumerate(givenargs) if i not in nums] |
517 args = pycompat.shlexsplit(cmd) |
517 args = pycompat.shlexsplit(cmd) |
518 return args + givenargs |
518 return args + givenargs |