mercurial/dispatch.py
changeset 45914 be25b66f86ab
parent 45912 35ab6e39f482
child 45918 ac565222b9f8
equal deleted inserted replaced
45913:9acbe30953e8 45914:be25b66f86ab
   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