Brett C. added the comment:

I went ahead and implemented the idea of hg or git prefixes on the commit 
numbers.

_______________________________________________________
PSF Meta Tracker <metatrac...@psf.upfronthosting.co.za>
<http://psf.upfronthosting.co.za/roundup/meta/issue610>
_______________________________________________________
diff -r 1b16b4c8ab77 extensions/local_replace.py
--- a/extensions/local_replace.py       Fri Dec 02 01:21:29 2016 +0200
+++ b/extensions/local_replace.py       Thu Dec 22 10:54:37 2016 -0800
@@ -74,10 +74,11 @@
 
 seps = r'\b(?<![-/?&;=_])'  # these chars should not precede the targets
 substitutions = [
-    # deadbeeffeed  (hashes with exactly twelve or forty chars)
-    (re.compile(r'%s(?P<revision>[a-fA-F0-9]{40})\b' % seps),
+    # deadbeeffeed  (hg hashes with exactly twelve or forty chars,
+    # git has 10 or more as it grows as time goes on)
+    (re.compile(r'%s(?P<revision>(git|hg)?[a-fA-F0-9]{40})\b' % seps),
      r'<a href="http://hg.python.org/lookup/\g<revision>">\g<revision></a>'),
-    (re.compile(r'%s(?P<revision>[a-fA-F0-9]{12})\b' % seps),
+    (re.compile(r'%s(?P<revision>(git|hg)?[a-fA-F0-9]{10,12})\b' % seps),
      r'<a href="http://hg.python.org/lookup/\g<revision>">\g<revision></a>'),
 
     # r12345, r 12345, rev12345, rev. 12345, revision12345, revision 12345
_______________________________________________
Tracker-discuss mailing list
Tracker-discuss@python.org
https://mail.python.org/mailman/listinfo/tracker-discuss
Code of Conduct: https://www.python.org/psf/codeofconduct/

Reply via email to