comparison mercurial/dispatch.py @ 31491:492c64afc54c

py3: make the regular expression bytes to prevent TypeError
author Pulkit Goyal <7895pulkit@gmail.com>
date Fri, 17 Mar 2017 05:10:58 +0530
parents dc9842a7017c
children 3c77414a0f9c
comparison
equal deleted inserted replaced
31490:8122cc5cb543 31491:492c64afc54c
284 num = int(m.group(1)) - 1 284 num = int(m.group(1)) - 1
285 nums.append(num) 285 nums.append(num)
286 if num < len(givenargs): 286 if num < len(givenargs):
287 return givenargs[num] 287 return givenargs[num]
288 raise error.Abort(_('too few arguments for command alias')) 288 raise error.Abort(_('too few arguments for command alias'))
289 cmd = re.sub(r'\$(\d+|\$)', replacer, cmd) 289 cmd = re.sub(br'\$(\d+|\$)', replacer, cmd)
290 givenargs = [x for i, x in enumerate(givenargs) 290 givenargs = [x for i, x in enumerate(givenargs)
291 if i not in nums] 291 if i not in nums]
292 args = pycompat.shlexsplit(cmd) 292 args = pycompat.shlexsplit(cmd)
293 return args + givenargs 293 return args + givenargs
294 294