]> Cypherpunks repositories - gostls13.git/commitdiff
goinstall: use correct checkout URL for Google Code svn repos
authorAndrew Gerrand <adg@golang.org>
Thu, 5 Jan 2012 22:20:59 +0000 (09:20 +1100)
committerAndrew Gerrand <adg@golang.org>
Thu, 5 Jan 2012 22:20:59 +0000 (09:20 +1100)
Fixes #2655.

R=golang-dev, gri
CC=golang-dev
https://golang.org/cl/5510045

src/cmd/goinstall/download.go
src/cmd/goinstall/download_test.go

index ccce680ce8e553620fc9865c9174b0f9b526c070..8e6cb4b373800d1fff1fad27be44174e68bbc020 100644 (file)
@@ -236,9 +236,13 @@ func (r *googleRepo) Repo(client *http.Client) (url, root string, vcs *vcs, err
        }
 
        // Scrape result for vcs details.
-       m := googleRepoRe.FindSubmatch(b)
-       if len(m) == 2 {
-               if v := vcsMap[string(m[1])]; v != nil {
+       if m := googleRepoRe.FindSubmatch(b); len(m) == 2 {
+               s := string(m[1])
+               if v := vcsMap[s]; v != nil {
+                       if s == "svn" {
+                               // Subversion still uses the old-style URL.
+                               r.url = fmt.Sprintf("http://%s.googlecode.com/svn", p[0])
+                       }
                        r.vcs = v
                        return r.url, r.root, r.vcs, nil
                }
index a4455a2ca565c4d87f381322ffe59c0ebdeb2d09..4104f71dd29ae612a2af5eea8716df6111c2fbd3 100644 (file)
@@ -31,7 +31,7 @@ var FindPublicRepoTests = []struct {
                "code.google.com/p/repo/path/foo",
                "svn",
                "code.google.com/p/repo",
-               "https://code.google.com/p/repo",
+               "https://repo.googlecode.com/svn",
                &testTransport{
                        "https://code.google.com/p/repo/source/checkout",
                        `<tt id="checkoutcmd">svn checkout https://...`,