[PATCH 1 of 3 stable] extdiff: reintroduce backward compatibility with manual quoting of parameters

Matt Mackall mpm at selenic.com
Tue Jan 27 16:53:30 CST 2015


On Tue, 2015-01-27 at 03:15 +0100, Mads Kiilerich wrote:
> # HG changeset patch
> # User Mads Kiilerich <madski at unity3d.com>
> # Date 1422323932 -3600
> #      Tue Jan 27 02:58:52 2015 +0100
> # Branch stable
> # Node ID aa7caa9b564fca7095f860178f18737cf360285d
> # Parent  0c4419faacbcca691737b5e25820dcbf4c7150ac
> extdiff: reintroduce backward compatibility with manual quoting of parameters

This had troubles:

$ python2.6
Python 2.6.7 (r267:88850, Aug  3 2011, 11:33:52) 
[GCC 4.6.1] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import re
>>> e = '''(['"]?)([^ '"]*)?'''
>>> re.compile(e)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python2.6/re.py", line 190, in compile
    return _compile(pattern, flags)
  File "/usr/lib/python2.6/re.py", line 245, in _compile
    raise error, v # invalid expression
sre_constants.error: nothing to repeat
>>> re.compile(e[:-1])
<_sre.SRE_Pattern object at 0x7fd8bd6e7128>
>>> 

Seems like the last ? is unnecessary, but I'd like to bounce it back to
you to confirm.

-- 
Mathematics is the supreme nostalgia of our time.




More information about the Mercurial-devel mailing list