# HG changeset patch # User HackBot # Date 1397951437 0 # Node ID 6df3986843756e46d948712bca84e55d9e5237f3 # Parent dd7f566433be427d4b51217c8eb17ab39f860cfc chmod +x url; mv url bin diff -r dd7f566433be -r 6df398684375 bin/url --- a/bin/url Sat Apr 19 23:50:25 2014 +0000 +++ b/bin/url Sat Apr 19 23:50:37 2014 +0000 @@ -1,7 +1,11 @@ #!/usr/bin/env python -import sys, urllib +import sys, re, urllib if len(sys.argv) <= 1: print "http://codu.org/projects/hackbot/fshg/" else: - print ("http://codu.org/projects/hackbot/fshg/index.cgi/file/tip/" + - urllib.quote(sys.argv[1])) + 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)) diff -r dd7f566433be -r 6df398684375 url --- a/url Sat Apr 19 23:50:25 2014 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,11 +0,0 @@ -#!/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))