# HG changeset patch # User Jeff Hammel # Date 1285095694 25200 # Node ID a963acb1713d726dbb817e929fc02b4e20d4978b # Parent 4dd12cf64c0e0bb523f2f6d116fe92effca37bc2 add a new handler: MercurialRevision diff -r 4dd12cf64c0e -r a963acb1713d setup.py --- a/setup.py Tue May 04 08:49:39 2010 -0700 +++ b/setup.py Tue Sep 21 12:01:34 2010 -0700 @@ -37,5 +37,6 @@ Trac = smartopen.handlers:Trac Bugzilla = smartopen.handlers:Bugzilla FedEx = smartopen.handlers:FedEx + MercurialRevision = smartopen.handlers:MercurialRevision """, ) diff -r 4dd12cf64c0e -r a963acb1713d smartopen/handlers.py --- a/smartopen/handlers.py Tue May 04 08:49:39 2010 -0700 +++ b/smartopen/handlers.py Tue Sep 21 12:01:34 2010 -0700 @@ -1,4 +1,5 @@ import address +import string import urllib import urllib2 @@ -138,3 +139,14 @@ except ValueError: return False return True + +class MercurialRevision(Location): + def __init__(self): + baseurl = 'http://hg.mozilla.org/mozilla-central/rev/' + Location.__init__(self, baseurl) + + def test(self, query): + query = set(query) + if query.issubset(string.digits + 'abcdef'): + return True + return False