go.tools/go/vcs: support cloned repos in code.google.com

R=golang-dev, bradfitz, dsymonds
CC=golang-dev
https://golang.org/cl/13241047
This commit is contained in:
Rob Pike 2013-08-29 13:50:05 +10:00
parent 1d214a6a09
commit b38e3512f0
2 changed files with 8 additions and 1 deletions

View File

@ -585,7 +585,7 @@ var vcsPaths = []*vcsPath{
// Google Code - new syntax
{
prefix: "code.google.com/",
re: `^(?P<root>code\.google\.com/p/(?P<project>[a-z0-9\-]+)(\.(?P<subrepo>[a-z0-9\-]+))?)(/[A-Za-z0-9_.\-]+)*$`,
re: `^(?P<root>code\.google\.com/(?:p|r)/(?P<project>[a-z0-9\-]+)(\.(?P<subrepo>[a-z0-9\-]+))?)(/[A-Za-z0-9_.\-]+)*$`,
repo: "https://{root}",
check: googleCodeVCS,
},

View File

@ -25,6 +25,13 @@ func TestRepoRootForImportPath(t *testing.T) {
Repo: "https://code.google.com/p/go",
},
},
{
"code.google.com/r/go",
&RepoRoot{
VCS: vcsHg,
Repo: "https://code.google.com/r/go",
},
},
{
"github.com/golang/groupcache",
&RepoRoot{