1
0
mirror of https://github.com/golang/go synced 2024-11-18 23:05:06 -07:00

go/vcs: drop support for Google Code Project Hosting

The hosting service was shut down on January 25, 2016 and a few tests
started to fail like the following:

=== RUN   TestRepoRootForImportPath
--- FAIL: TestRepoRootForImportPath (2.47s)
	vcs_test.go:129: RepoRootForImport("code.google.com/p/go"):
unable to detect version control system for code.google.com/ path
FAIL

This change drops support for code.google.com and fixes test. See
http://google-opensource.blogspot.jp/2015/03/farewell-to-google-code.html
for further information.

Fixes golang/go#14105

Change-Id: I87cb9a3d666c2a1af0f8bf39a66ba0f669c99fd5
Reviewed-on: https://go-review.googlesource.com/18951
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
This commit is contained in:
Mikio Hara 2016-01-26 12:31:33 +09:00 committed by Brad Fitzpatrick
parent ce967854d3
commit 7421583666
2 changed files with 0 additions and 67 deletions

View File

@ -598,20 +598,6 @@ var vcsPaths = []*vcsPath{
check: noVCSSuffix, check: noVCSSuffix,
}, },
// Google Code - new syntax
{
prefix: "code.google.com/",
re: `^(?P<root>code\.google\.com/[pr]/(?P<project>[a-z0-9\-]+)(\.(?P<subrepo>[a-z0-9\-]+))?)(/[A-Za-z0-9_.\-]+)*$`,
repo: "https://{root}",
check: googleCodeVCS,
},
// Google Code - old syntax
{
re: `^(?P<project>[a-z0-9_\-.]+)\.googlecode\.com/(git|hg|svn)(?P<path>/.*)?$`,
check: oldGoogleCode,
},
// Github // Github
{ {
prefix: "github.com/", prefix: "github.com/",
@ -667,45 +653,6 @@ func noVCSSuffix(match map[string]string) error {
return nil return nil
} }
var googleCheckout = regexp.MustCompile(`id="checkoutcmd">(hg|git|svn)`)
// googleCodeVCS determines the version control system for
// a code.google.com repository, by scraping the project's
// /source/checkout page.
func googleCodeVCS(match map[string]string) error {
if err := noVCSSuffix(match); err != nil {
return err
}
data, err := httpGET(expand(match, "https://code.google.com/p/{project}/source/checkout?repo={subrepo}"))
if err != nil {
return err
}
if m := googleCheckout.FindSubmatch(data); m != nil {
if vcs := ByCmd(string(m[1])); vcs != nil {
// Subversion requires the old URLs.
// TODO: Test.
if vcs == vcsSvn {
if match["subrepo"] != "" {
return fmt.Errorf("sub-repositories not supported in Google Code Subversion projects")
}
match["repo"] = expand(match, "https://{project}.googlecode.com/svn")
}
match["vcs"] = vcs.Cmd
return nil
}
}
return fmt.Errorf("unable to detect version control system for code.google.com/ path")
}
// oldGoogleCode is invoked for old-style foo.googlecode.com paths.
// It prints an error giving the equivalent new path.
func oldGoogleCode(match map[string]string) error {
return fmt.Errorf("invalid Google Code import path: use %s instead",
expand(match, "code.google.com/p/{project}{path}"))
}
// bitbucketVCS determines the version control system for a // bitbucketVCS determines the version control system for a
// Bitbucket repository, by using the Bitbucket API. // Bitbucket repository, by using the Bitbucket API.
func bitbucketVCS(match map[string]string) error { func bitbucketVCS(match map[string]string) error {

View File

@ -26,20 +26,6 @@ func TestRepoRootForImportPath(t *testing.T) {
path string path string
want *RepoRoot want *RepoRoot
}{ }{
{
"code.google.com/p/go",
&RepoRoot{
VCS: vcsHg,
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", "github.com/golang/groupcache",
&RepoRoot{ &RepoRoot{