From b38e3512f0b2f027568401adec5586e614e0749e Mon Sep 17 00:00:00 2001 From: Rob Pike Date: Thu, 29 Aug 2013 13:50:05 +1000 Subject: [PATCH] go.tools/go/vcs: support cloned repos in code.google.com R=golang-dev, bradfitz, dsymonds CC=golang-dev https://golang.org/cl/13241047 --- go/vcs/vcs.go | 2 +- go/vcs/vcs_test.go | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/go/vcs/vcs.go b/go/vcs/vcs.go index 29242e3b..059f6151 100644 --- a/go/vcs/vcs.go +++ b/go/vcs/vcs.go @@ -585,7 +585,7 @@ var vcsPaths = []*vcsPath{ // Google Code - new syntax { prefix: "code.google.com/", - re: `^(?Pcode\.google\.com/p/(?P[a-z0-9\-]+)(\.(?P[a-z0-9\-]+))?)(/[A-Za-z0-9_.\-]+)*$`, + re: `^(?Pcode\.google\.com/(?:p|r)/(?P[a-z0-9\-]+)(\.(?P[a-z0-9\-]+))?)(/[A-Za-z0-9_.\-]+)*$`, repo: "https://{root}", check: googleCodeVCS, }, diff --git a/go/vcs/vcs_test.go b/go/vcs/vcs_test.go index 0651ecff..0b8dd8c8 100644 --- a/go/vcs/vcs_test.go +++ b/go/vcs/vcs_test.go @@ -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{