view bin/url @ 4587:6df398684375

<oerjan> chmod +x url; mv url bin
author HackBot
date Sat, 19 Apr 2014 23:50:37 +0000
parents 5a4571b62410
children b873f9de779b
line wrap: on
line source

#!/usr/bin/env python
import sys, re, urllib
if len(sys.argv) <= 1:
    print "http://codu.org/projects/hackbot/fshg/"
else:
    f = re.sub(r"^/hackenv/", "", sys.argv[1])
    if f.startswith("/"):
        sys.exit("File is outside hg repository")
    else:
        print ("http://codu.org/projects/hackbot/fshg/index.cgi/file/tip/" +
            urllib.quote(f))