Updating to vcs 1.10.2
diff --git a/glide.lock b/glide.lock index 5a9fee4..6622eaa 100644 --- a/glide.lock +++ b/glide.lock
@@ -1,12 +1,12 @@ -hash: e36c5a71bd15a6d2f7f795a68b0fbfbd41537ee29aec16e7105bd8fd3ef118ee -updated: 2017-01-12T13:12:10.704271522-05:00 +hash: d4ba37e19ce11b569a279704436594a242b9a389c9f2b54dc621d5a794329155 +updated: 2017-01-24T09:52:54.173692927-05:00 imports: - name: github.com/codegangsta/cli version: 0bdeddeeb0f650497d603c4ad7b20cfe685682f6 - name: github.com/Masterminds/semver version: 59c29afe1a994eacb71c833025ca7acf874bb1da - name: github.com/Masterminds/vcs - version: 87fca6b9ec721bb38f1e9f2e3c0a36c78f6067d5 + version: 2b467644127097f69ed9c9829a0c5f757a804cee - name: github.com/mitchellh/go-homedir version: b8bc1bf767474819792c23f32d8286a45736f1c6 - name: gopkg.in/yaml.v2
diff --git a/glide.yaml b/glide.yaml index 875506c..206d2f2 100644 --- a/glide.yaml +++ b/glide.yaml
@@ -11,7 +11,7 @@ import: - package: gopkg.in/yaml.v2 - package: github.com/Masterminds/vcs - version: ^1.8.0 + version: ^1.10.2 - package: github.com/codegangsta/cli version: ^1.16.0 - package: github.com/Masterminds/semver
diff --git a/vendor/github.com/Masterminds/vcs/.travis.yml b/vendor/github.com/Masterminds/vcs/.travis.yml index b14aeb8..1421a8e 100644 --- a/vendor/github.com/Masterminds/vcs/.travis.yml +++ b/vendor/github.com/Masterminds/vcs/.travis.yml
@@ -1,7 +1,6 @@ language: go go: - - 1.5 - 1.6 - 1.7 - tip
diff --git a/vendor/github.com/Masterminds/vcs/CHANGELOG.md b/vendor/github.com/Masterminds/vcs/CHANGELOG.md index 4379d3f..e19c998 100644 --- a/vendor/github.com/Masterminds/vcs/CHANGELOG.md +++ b/vendor/github.com/Masterminds/vcs/CHANGELOG.md
@@ -1,3 +1,13 @@ +# 1.10.2 (2017-01-24) + +## Fixed +- #63: Remove extra quotes in submodule export (thanks @dt) + +# 1.10.1 (2017-01-18) + +## Fixed +- #62: Added windows testing via appveyor and fixed issues under windows. + # 1.10.0 (2017-01-09) ## Added
diff --git a/vendor/github.com/Masterminds/vcs/README.md b/vendor/github.com/Masterminds/vcs/README.md index cdb981f..a112685 100644 --- a/vendor/github.com/Masterminds/vcs/README.md +++ b/vendor/github.com/Masterminds/vcs/README.md
@@ -4,6 +4,8 @@ interface. [](https://travis-ci.org/Masterminds/vcs) [](https://godoc.org/github.com/Masterminds/vcs) [](https://goreportcard.com/report/github.com/Masterminds/vcs) +[](https://ci.appveyor.com/project/mattfarina/vcs) + ## Quick Usage
diff --git a/vendor/github.com/Masterminds/vcs/appveyor.yml b/vendor/github.com/Masterminds/vcs/appveyor.yml new file mode 100644 index 0000000..c0c9170 --- /dev/null +++ b/vendor/github.com/Masterminds/vcs/appveyor.yml
@@ -0,0 +1,26 @@ + +version: build-{build}.{branch} + +clone_folder: C:\gopath\src\github.com\Masterminds\vcs +shallow_clone: true + +environment: + GOPATH: C:\gopath + +platform: + - x64 + +install: + - go version + - go env + - choco install -y bzr + - set PATH=C:\Program Files (x86)\Bazaar;%PATH% + - bzr --version + +build_script: + - go install -v ./... + +test_script: + - go test -v + +deploy: off
diff --git a/vendor/github.com/Masterminds/vcs/git.go b/vendor/github.com/Masterminds/vcs/git.go index dcf6278..c9e17ca 100644 --- a/vendor/github.com/Masterminds/vcs/git.go +++ b/vendor/github.com/Masterminds/vcs/git.go
@@ -371,13 +371,21 @@ dir = dir + string(os.PathSeparator) } + // checkout-index on some systems, such as some Windows cases, does not + // create the parent directory to export into if it does not exist. Explicitly + // creating it. + err := os.MkdirAll(dir, 0755) + if err != nil { + return NewLocalError("Unable to create directory", err, "") + } + out, err := s.RunFromDir("git", "checkout-index", "-f", "-a", "--prefix="+dir) s.log(out) if err != nil { return NewLocalError("Unable to export source", err, string(out)) } // and now, the horror of submodules - out, err = s.RunFromDir("git", "submodule", "foreach", "--recursive", "'git checkout-index -f -a --prefix=\""+filepath.Join(dir, "$path")+"\"'") + out, err = s.RunFromDir("git", "submodule", "foreach", "--recursive", "git checkout-index -f -a --prefix=\""+filepath.Join(dir, "$path")+string(filepath.Separator)+"\"") s.log(out) if err != nil { return NewLocalError("Error while exporting submodule sources", err, string(out))
diff --git a/vendor/github.com/Masterminds/vcs/repo_test.go b/vendor/github.com/Masterminds/vcs/repo_test.go index fef0bcb..8c083b3 100644 --- a/vendor/github.com/Masterminds/vcs/repo_test.go +++ b/vendor/github.com/Masterminds/vcs/repo_test.go
@@ -46,7 +46,7 @@ } }() - repo, err := NewSvnRepo("https://github.com/Masterminds/VCSTestRepo/trunk", tempDir+"/VCSTestRepo") + repo, err := NewSvnRepo("https://github.com/Masterminds/VCSTestRepo/trunk", tempDir+string(os.PathSeparator)+"VCSTestRepo") if err != nil { t.Error(err) } @@ -55,7 +55,7 @@ t.Errorf("Unable to checkout SVN repo for repo switching tests. Err was %s", err) } - _, err = NewRepo("https://github.com/Masterminds/VCSTestRepo", tempDir+"/VCSTestRepo") + _, err = NewRepo("https://github.com/Masterminds/VCSTestRepo", tempDir+string(os.PathSeparator)+"VCSTestRepo") if err != ErrWrongVCS { t.Errorf("Not detecting repo switch from SVN to Git") }
diff --git a/vendor/github.com/Masterminds/vcs/svn.go b/vendor/github.com/Masterminds/vcs/svn.go index 895f93e..913f90a 100644 --- a/vendor/github.com/Masterminds/vcs/svn.go +++ b/vendor/github.com/Masterminds/vcs/svn.go
@@ -6,6 +6,7 @@ "os" "os/exec" "path/filepath" + "runtime" "strings" "time" ) @@ -76,6 +77,8 @@ remote := s.Remote() if strings.HasPrefix(remote, "/") { remote = "file://" + remote + } else if runtime.GOOS == "windows" && filepath.VolumeName(remote) != "" { + remote = "file:///" + remote } out, err := s.run("svn", "checkout", remote, s.LocalPath()) if err != nil { @@ -183,8 +186,8 @@ if err != nil { return time.Time{}, NewLocalError("Unable to retrieve revision date", err, string(out)) } - const longForm = "2006-01-02T15:04:05.000000Z\n" - t, err := time.Parse(longForm, string(out)) + const longForm = "2006-01-02T15:04:05.000000Z" + t, err := time.Parse(longForm, strings.TrimSpace(string(out))) if err != nil { return time.Time{}, NewLocalError("Unable to retrieve revision date", err, string(out)) } @@ -193,14 +196,24 @@ // CheckLocal verifies the local location is an SVN repo. func (s *SvnRepo) CheckLocal() bool { - sep := fmt.Sprintf("%c", os.PathSeparator) - psplit := strings.Split(s.LocalPath(), sep) - for i := 0; i < len(psplit); i++ { - path := fmt.Sprintf("%s%s", sep, filepath.Join(psplit[0:(len(psplit)-(i))]...)) - if _, err := os.Stat(filepath.Join(path, ".svn")); err == nil { + pth, err := filepath.Abs(s.LocalPath()) + if err != nil { + s.log(err.Error()) + return false + } + + if _, err := os.Stat(filepath.Join(pth, ".svn")); err == nil { + return true + } + + oldpth := pth + for oldpth != pth { + pth = filepath.Dir(pth) + if _, err := os.Stat(filepath.Join(pth, ".svn")); err == nil { return true } } + return false }
diff --git a/vendor/github.com/Masterminds/vcs/svn_test.go b/vendor/github.com/Masterminds/vcs/svn_test.go index dfa0af8..93fc139 100644 --- a/vendor/github.com/Masterminds/vcs/svn_test.go +++ b/vendor/github.com/Masterminds/vcs/svn_test.go
@@ -28,7 +28,7 @@ } }() - repo, err := NewSvnRepo("https://github.com/Masterminds/VCSTestRepo/trunk", tempDir+"/VCSTestRepo") + repo, err := NewSvnRepo("https://github.com/Masterminds/VCSTestRepo/trunk", tempDir+string(os.PathSeparator)+"VCSTestRepo") if err != nil { t.Error(err) } @@ -41,7 +41,7 @@ if repo.Remote() != "https://github.com/Masterminds/VCSTestRepo/trunk" { t.Error("Remote not set properly") } - if repo.LocalPath() != tempDir+"/VCSTestRepo" { + if repo.LocalPath() != tempDir+string(os.PathSeparator)+"VCSTestRepo" { t.Error("Local disk location not set properly") } @@ -300,8 +300,8 @@ func TestSvnInit(t *testing.T) { tempDir, err := ioutil.TempDir("", "go-vcs-svn-tests") - remoteDir := tempDir + "/remoteDir" - localDir := tempDir + "/localDir" + remoteDir := tempDir + string(os.PathSeparator) + "remoteDir" + localDir := tempDir + string(os.PathSeparator) + "localDir" if err != nil { t.Error(err) }
diff --git a/vendor/github.com/Masterminds/vcs/vcs_local_lookup.go b/vendor/github.com/Masterminds/vcs/vcs_local_lookup.go index 0709f61..09f6e22 100644 --- a/vendor/github.com/Masterminds/vcs/vcs_local_lookup.go +++ b/vendor/github.com/Masterminds/vcs/vcs_local_lookup.go
@@ -2,12 +2,20 @@ import ( "os" + "runtime" + "strings" ) // DetectVcsFromFS detects the type from the local path. // Is there a better way to do this? func DetectVcsFromFS(vcsPath string) (Type, error) { + // There are cases under windows that a path could start with a / and it needs + // to be stripped. For example, a path such as /C:\foio\bar. + if runtime.GOOS == "windows" && strings.HasPrefix(vcsPath, "/") { + vcsPath = strings.TrimPrefix(vcsPath, "/") + } + // When the local directory to the package doesn't exist // it's not yet downloaded so we can't detect the type // locally.
diff --git a/vendor/github.com/Masterminds/vcs/vcs_remote_lookup_test.go b/vendor/github.com/Masterminds/vcs/vcs_remote_lookup_test.go index 395ee79..938cb0e 100644 --- a/vendor/github.com/Masterminds/vcs/vcs_remote_lookup_test.go +++ b/vendor/github.com/Masterminds/vcs/vcs_remote_lookup_test.go
@@ -4,6 +4,7 @@ "io/ioutil" "os" "os/exec" + "runtime" "strings" "testing" ) @@ -92,7 +93,14 @@ t.Error(err) } - pth := "file://" + tempDir + // On Windows it should be file:// followed by /C:\for\bar. That / before + // the drive needs to be included in testing. + var pth string + if runtime.GOOS == "windows" { + pth = "file:///" + tempDir + } else { + pth = "file://" + tempDir + } ty, _, err := detectVcsFromRemote(pth) if err != nil {