Mercurial > repo
comparison bin/url @ 8136:a33356304892
<oerjan> ` sed -i \'8s/..hg/(?:&|tmp)/\' bin/url
author | HackBot |
---|---|
date | Wed, 25 May 2016 01:38:44 +0000 |
parents | 06b216292e6b |
children |
comparison
equal
deleted
inserted
replaced
8135:06b216292e6b | 8136:a33356304892 |
---|---|
3 if len(sys.argv) <= 1: | 3 if len(sys.argv) <= 1: |
4 print "http://codu.org/projects/hackbot/fshg/" | 4 print "http://codu.org/projects/hackbot/fshg/" |
5 else: | 5 else: |
6 f = os.path.abspath(sys.argv[1]) | 6 f = os.path.abspath(sys.argv[1]) |
7 f = re.sub(r"^/+hackenv/", "", f) | 7 f = re.sub(r"^/+hackenv/", "", f) |
8 if re.match(r"/|\.hg(?:/|$)",f): | 8 if re.match(r"/|(?:\.hg|tmp)(?:/|$)",f): |
9 sys.exit("File is outside web-viewable filesystem repository.") | 9 sys.exit("File is outside web-viewable filesystem repository.") |
10 else: | 10 else: |
11 print ("http://codu.org/projects/hackbot/fshg/index.cgi/file/tip/" + | 11 print ("http://codu.org/projects/hackbot/fshg/index.cgi/file/tip/" + |
12 urllib.quote(f)) | 12 urllib.quote(f)) |