Commits

Anonymous committed 4d464bf

Make "rev. 12345" work too.

Comments (0)

Files changed (2)

extensions/local_replace.py

     (re.compile(r'\b(?<![/?&;=])(?P<revision>[a-fA-F0-9]{12})\b'),
      r'<a href="http://hg.python.org/lookup/\g<revision>">\g<revision></a>'),
 
-    # r12345, r 12345, rev12345, rev 12345, revision12345, revision 12345
-    (re.compile(r'\b(?<![/?&;])(?P<revstr>r(ev(ision)?)?\s*)(?P<revision>\d{4,})'),
+    # r12345, r 12345, rev12345, rev. 12345, revision12345, revision 12345
+    (re.compile(r'\b(?<![/?&;])(?P<revstr>r\.?(ev\.?(ision)?)?\s*)(?P<revision>\d{4,})'),
      r'<a href="http://hg.python.org/lookup/r\g<revision>">\g<revstr>\g<revision></a>'),
 
     # Lib/somefile.py, Lib/somefile.py:123, Modules/somemodule.c:123, ...

extensions/test/local_replace_data.txt

  <a href="http://hg.python.org/lookup/r2222">r2222</a>
  r 2222
  <a href="http://hg.python.org/lookup/r2222">r 2222</a>
+ r. 2222
+ <a href="http://hg.python.org/lookup/r2222">r. 2222</a>
  rev2222
  <a href="http://hg.python.org/lookup/r2222">rev2222</a>
  rev  2222
  <a href="http://hg.python.org/lookup/r2222">rev  2222</a>
+ rev.  2222
+ <a href="http://hg.python.org/lookup/r2222">rev.  2222</a>
  revision2222
  <a href="http://hg.python.org/lookup/r2222">revision2222</a>
  revision 2222
  #1234567890123
 pyissue1000
 pyissue1000
+http://mail.python.org/pipermail/python-ideas/2011-October/thread.html#12459
+<a href="http://mail.python.org/pipermail/python-ideas/2011-October/thread.html#12459">http://mail.python.org/pipermail/python-ideas/2011-October/thread.html#12459</a>
 ##
 ## files - Lib/somefile.py, Modules/somemodule.c, Doc/somedocfile.rst, ...
 Lib/cgi.py