x/tools/go/vcs: support go.googlecode.com paths
Also fix a bug in CreateAtRev, which was doing something hg-specific. LGTM=cmang R=cmang CC=golang-codereviews https://golang.org/cl/180540043
This commit is contained in:
parent
41f0d01034
commit
a652b8bab4
|
@ -239,9 +239,10 @@ func (v *Cmd) Create(dir, repo string) error {
|
||||||
// The parent of dir must exist; dir must not.
|
// The parent of dir must exist; dir must not.
|
||||||
// rev must be a valid revision in repo.
|
// rev must be a valid revision in repo.
|
||||||
func (v *Cmd) CreateAtRev(dir, repo, rev string) error {
|
func (v *Cmd) CreateAtRev(dir, repo, rev string) error {
|
||||||
// Append revision flag to CreateCmd
|
if err := v.Create(dir, repo); err != nil {
|
||||||
createAtRevCmd := v.CreateCmd + " --rev=" + rev
|
return err
|
||||||
return v.run(".", createAtRevCmd, "dir", dir, "repo", repo)
|
}
|
||||||
|
return v.run(dir, v.TagSyncCmd, "tag", rev)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Download downloads any new changes for the repo in dir.
|
// Download downloads any new changes for the repo in dir.
|
||||||
|
@ -589,6 +590,15 @@ func expand(match map[string]string, s string) string {
|
||||||
|
|
||||||
// vcsPaths lists the known vcs paths.
|
// vcsPaths lists the known vcs paths.
|
||||||
var vcsPaths = []*vcsPath{
|
var vcsPaths = []*vcsPath{
|
||||||
|
// go.googlesource.com
|
||||||
|
{
|
||||||
|
prefix: "go.googlesource.com",
|
||||||
|
re: `^(?P<root>go\.googlesource\.com/[A-Za-z0-9_.\-]+/?)$`,
|
||||||
|
vcs: "git",
|
||||||
|
repo: "https://{root}",
|
||||||
|
check: noVCSSuffix,
|
||||||
|
},
|
||||||
|
|
||||||
// Google Code - new syntax
|
// Google Code - new syntax
|
||||||
{
|
{
|
||||||
prefix: "code.google.com/",
|
prefix: "code.google.com/",
|
||||||
|
|
Loading…
Reference in New Issue