summaryrefslogtreecommitdiff
path: root/misc/dashboard/godashboard/package.py
diff options
context:
space:
mode:
authorOndřej Surý <ondrej@sury.org>2011-06-28 15:28:34 +0200
committerOndřej Surý <ondrej@sury.org>2011-06-28 15:28:34 +0200
commit8d00b02d82d86abe51773dc2c1751843bb538ae5 (patch)
tree6656d166a046fc751548e88f071fedbeb9355443 /misc/dashboard/godashboard/package.py
parentc29cace1e8f3260389ea78fa4ef86d80cd5e5275 (diff)
downloadgolang-8d00b02d82d86abe51773dc2c1751843bb538ae5.tar.gz
Imported Upstream version 2011.06.23upstream-weekly/2011.06.23
Diffstat (limited to 'misc/dashboard/godashboard/package.py')
-rw-r--r--misc/dashboard/godashboard/package.py9
1 files changed, 4 insertions, 5 deletions
diff --git a/misc/dashboard/godashboard/package.py b/misc/dashboard/godashboard/package.py
index a1bca1908..dd09593ac 100644
--- a/misc/dashboard/godashboard/package.py
+++ b/misc/dashboard/godashboard/package.py
@@ -45,7 +45,7 @@ class Project(db.Model):
re_bitbucket = re.compile(r'^bitbucket\.org/[a-z0-9A-Z_.\-]+/[a-z0-9A-Z_.\-]+$')
re_googlecode = re.compile(r'^[a-z0-9\-]+\.googlecode\.com/(svn|hg)$')
-re_github = re.compile(r'^github\.com/[a-z0-9A-Z_.\-]+/[a-z0-9A-Z_.\-]+$')
+re_github = re.compile(r'^github\.com/[a-z0-9A-Z_.\-]+(/[a-z0-9A-Z_.\-]+)+$')
re_launchpad = re.compile(r'^launchpad\.net/([a-z0-9A-Z_.\-]+(/[a-z0-9A-Z_.\-]+)?|~[a-z0-9A-Z_.\-]+/(\+junk|[a-z0-9A-Z_.\-]+)/[a-z0-9A-Z_.\-]+)(/[a-z0-9A-Z_.\-/]+)?$')
@@ -54,10 +54,9 @@ def vc_to_web(path):
check_url = 'http://' + path + '/?cmd=heads'
web = 'http://' + path + '/'
elif re_github.match(path):
- # github doesn't let you fetch the .git directory anymore.
- # fetch .git/info/refs instead, like git clone would.
- check_url = 'http://'+path+'.git/info/refs'
- web = 'http://' + path
+ m = re_github_web.match(path)
+ check_url = 'https://raw.github.com/' + m.group(1) + '/' + m.group(2) + '/master/'
+ web = 'http://github.com/' + m.group(1) + '/' + m.group(2)
elif re_googlecode.match(path):
check_url = 'http://'+path
web = 'http://code.google.com/p/' + path[:path.index('.')]