]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/go: remove code specific to Google Code
authorDominik Honnef <dominik@honnef.co>
Mon, 28 Mar 2016 00:44:43 +0000 (02:44 +0200)
committerBrad Fitzpatrick <bradfitz@golang.org>
Mon, 28 Mar 2016 05:37:04 +0000 (05:37 +0000)
Remove all special handling of Google Code, which has shut down.

Commit 4ec2fd3e6ac4f869d39348bf48016687b731d910 suggested that maybe the
shutdown warning should remain. However, it has been missing from Go 1.6
already, and by Go 1.7 people will most likely have realised that Google
Code has shut down.

Updates #10193.

Change-Id: I5749bbbe2fe3b07cff4edd20303bbedaeaa8d77b
Reviewed-on: https://go-review.googlesource.com/21189
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

src/cmd/go/alldocs.go
src/cmd/go/get.go
src/cmd/go/go_test.go
src/cmd/go/help.go
src/cmd/go/vcs.go
src/cmd/go/vcs_test.go

index a58ffe86132ccaa32033a7a2a76d221019de9029..1f5981055c83762a0c844c08fa8b1ae2680904ab 100644 (file)
@@ -1144,14 +1144,6 @@ A few common code hosting sites have special syntax:
                import "github.com/user/project"
                import "github.com/user/project/sub/directory"
 
-       Google Code Project Hosting (Git, Mercurial, Subversion)
-
-               import "code.google.com/p/project"
-               import "code.google.com/p/project/sub/directory"
-
-               import "code.google.com/p/project.subrepository"
-               import "code.google.com/p/project.subrepository/sub/directory"
-
        Launchpad (Bazaar)
 
                import "launchpad.net/project"
index 56a34c0b1b85618d577cf020cbda309bffa0cd5e..7e0045fb1dce9738b543abc1f7a817f1106c7d16 100644 (file)
@@ -236,16 +236,6 @@ func download(arg string, parent *Package, stk *importStack, mode int) {
                        stk.pop()
                        return
                }
-
-               // Warn that code.google.com is shutting down. We
-               // issue the warning here because this is where we
-               // have the import stack.
-               if strings.HasPrefix(p.ImportPath, "code.google.com") {
-                       fmt.Fprintf(os.Stderr, "warning: code.google.com is shutting down; import path %v will stop working\n", p.ImportPath)
-                       if len(*stk) > 1 {
-                               fmt.Fprintf(os.Stderr, "warning: package %v\n", strings.Join(*stk, "\n\timports "))
-                       }
-               }
                stk.pop()
 
                args := []string{arg}
index 05e509d41dd81367723424cdb12a7a574da50fa6..3e595d187f31ea93a3517323dd02c8fa532089de 100644 (file)
@@ -2439,22 +2439,6 @@ func TestGoGetInsecureCustomDomain(t *testing.T) {
        tg.run("get", "-d", "-insecure", repo)
 }
 
-func TestIssue10193(t *testing.T) {
-       t.Skip("depends on code.google.com")
-       testenv.MustHaveExternalNetwork(t)
-       if _, err := exec.LookPath("hg"); err != nil {
-               t.Skip("skipping because hg binary not found")
-       }
-
-       tg := testgo(t)
-       defer tg.cleanup()
-       tg.parallel()
-       tg.tempDir("src")
-       tg.setenv("GOPATH", tg.path("."))
-       tg.runFail("get", "code.google.com/p/rsc/pdf")
-       tg.grepStderr("is shutting down", "missed warning about code.google.com")
-}
-
 func TestGoRunDirs(t *testing.T) {
        tg := testgo(t)
        defer tg.cleanup()
index 9adfd5b72a1cb7dccb7d46f7ba4df03498e7b019..394e1715942ec0e9d3775474f2602ac4c7adc64c 100644 (file)
@@ -149,14 +149,6 @@ A few common code hosting sites have special syntax:
                import "github.com/user/project"
                import "github.com/user/project/sub/directory"
 
-       Google Code Project Hosting (Git, Mercurial, Subversion)
-
-               import "code.google.com/p/project"
-               import "code.google.com/p/project/sub/directory"
-
-               import "code.google.com/p/project.subrepository"
-               import "code.google.com/p/project.subrepository/sub/directory"
-
        Launchpad (Bazaar)
 
                import "launchpad.net/project"
index 8d480d74fb5a69dcda63a24c1072c291d06a6303..a9663b21856ba0039fe2258338341609d49f0927 100644 (file)
@@ -815,20 +815,6 @@ func expand(match map[string]string, s string) string {
 // and import paths referring to a fully-qualified importPath
 // containing a VCS type (foo.com/repo.git/dir)
 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_.\-]+)*$`,
-               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
        {
                prefix: "github.com/",
@@ -911,45 +897,6 @@ func noVCSSuffix(match map[string]string) error {
        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 := vcsByCmd(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
 // Bitbucket repository, by using the Bitbucket API.
 func bitbucketVCS(match map[string]string) error {
index d817ce3ed0517241bdf6d7afddae3458eeef4ddb..52a534a3a3332c73d9ab64adda5f8eb82b9c2334 100644 (file)
@@ -18,20 +18,6 @@ func TestRepoRootForImportPath(t *testing.T) {
                path string
                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",
                        &repoRoot{