Commit 508a22d5 authored by Andrew Gerrand's avatar Andrew Gerrand

misc/makerelease: use new storage api, handle git sub-repos

Change-Id: I8c5b77d861aafdc594714982503da7bee053c9fe
Reviewed-on: https://go-review.googlesource.com/1291Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
parent 38ecd2e2
......@@ -14,6 +14,7 @@ import (
"compress/gzip"
"crypto/sha1"
"encoding/json"
"errors"
"flag"
"fmt"
"io"
......@@ -30,7 +31,7 @@ import (
"strings"
"code.google.com/p/goauth2/oauth"
storage "code.google.com/p/google-api-go-client/storage/v1beta2"
storage "code.google.com/p/google-api-go-client/storage/v1"
)
var (
......@@ -512,8 +513,15 @@ func (b *Build) get(repoPath, revision string) error {
}
// Update the repo to the specified revision.
p := filepath.Join(b.gopath, "src", filepath.FromSlash(repoPath))
_, err = b.run(p, "hg", "update", revision)
dest := filepath.Join(b.gopath, "src", filepath.FromSlash(repoPath))
switch {
case exists(filepath.Join(dest, ".git")):
_, err = b.run(dest, "git", "checkout", revision)
case exists(filepath.Join(dest, ".hg")):
_, err = b.run(dest, "hg", "update", revision)
default:
err = errors.New("unknown version control system")
}
return err
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment