view bin/url @ 4588:b873f9de779b

<oerjan> sed -i \'s/repository/repository./\' bin/url
author HackBot
date Sat, 19 Apr 2014 23:52:15 +0000
parents 6df398684375
children 54ff46129c36
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))