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>
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"
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}
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()
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"
// 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/",
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 {
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{