This change synchronizes the absence of a special case entry for
go.googlesource.com import paths in cmd/go/internal/get to this
package. It seems it was added to x/tools/go/vcs in CL 180540043,
but it was never added to cmd/go/internal/get itself.
Having an go.googlesource.com entry here but not in cmd/go/internal/get
means the import path resolution logic diverges from that of the go
command, which is counter to the goal of this package.
After this change is applied, vcs.RepoRootForImportPathStatic reports
correct results for import paths like "go.googlesource.com/scratch.git"
(resolving it without an error) and "go.googlesource.com/scratch"
(reporting an error).
Updates golang/go#11490
Change-Id: I0b1c959675d9e20205a587a06d734fcd103ebf91
Reviewed-on: https://go-review.googlesource.com/c/159817
Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Apply same change as CL 94656 did for cmd/go/internal/get, but for
golang.org/x/tools/go/vcs, to help keep them in sync.
It indirectly includes changes from CL 94603, since CL 94656 was
rebased on top of CL 94603.
Updates golang/go#23867.
Helps golang/go#11490.
Change-Id: I33eca1aba19f47bbe3e83d4ef9f9cc9a9c9ae975
Reviewed-on: https://go-review.googlesource.com/94899
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Manually apply same change as CL 68110 did for cmd/go/internal/get,
but for golang.org/x/tools/go/vcs, to help keep them in sync.
Updates golang/go#22125.
Helps golang/go#11490.
Change-Id: I255f7a494d9572389fc8dc8ce96891b6fcc214a0
Reviewed-on: https://go-review.googlesource.com/68352
Reviewed-by: Russ Cox <rsc@golang.org>
Manually apply same change as CL 41822 did for cmd/go/internal/get,
but for golang.org/x/tools/go/vcs, to help keep them in sync.
Updates golang/go#18660.
Helps golang/go#11490.
Change-Id: I6c7759c073583dea771bc438b70f8c2eb7b5ebfb
Reviewed-on: https://go-review.googlesource.com/42017
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Go is being proposed as an officially supported language for elements of
OpenStack:
https://review.openstack.org/#/c/312267/
As such, repos that exist in OpenStack's git infrastructure
are likely to become places from which people might want to go get
things. Allow optional .git suffixes to allow writing code that
depends on git.openstack.org repos that will work with older go versions
while we wait for this support to roll out.
Change-Id: I1f7be6b7aae63f9c554dbcdbfa46855bcff321df
Reviewed-on: https://go-review.googlesource.com/23362
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Apply style improvements to TestFromDir from golang/go@b6cd6d7d32,
in order to keep them in sync.
Check for error when creating a directory, its successful existence is a
precondition for the test to run.
Helps golang/go#11490.
Change-Id: I87054114c84aead96977f603ca3bd9eccfcfbd5e
Reviewed-on: https://go-review.googlesource.com/21795
Reviewed-by: Alex Brainman <alex.brainman@gmail.com>
The hosting service was shut down on January 25, 2016 and a few tests
started to fail like the following:
=== RUN TestRepoRootForImportPath
--- FAIL: TestRepoRootForImportPath (2.47s)
vcs_test.go:129: RepoRootForImport("code.google.com/p/go"):
unable to detect version control system for code.google.com/ path
FAIL
This change drops support for code.google.com and fixes test. See
http://google-opensource.blogspot.jp/2015/03/farewell-to-google-code.html
for further information.
Fixesgolang/go#14105
Change-Id: I87cb9a3d666c2a1af0f8bf39a66ba0f669c99fd5
Reviewed-on: https://go-review.googlesource.com/18951
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Import path is a '/'-separated path. FromDir documentation says
on return, root is the import path corresponding to the root of
the repository. On Windows and other OSes where os.PathSeparator
is not '/', that wasn't true since root would contain characters
other than '/', and therefore it wasn't a valid import path
corresponding to the root of the repository. Fix that by using
filepath.ToSlash.
Add test coverage for root value returned from FromDir, it was
previously not tested.
Additionally, remove a dubious statement from the documentation
"(thus root is a prefix of importPath)". There is no variable
importPath that is being referred to. It's also redundant and
confusing. Without it, the description of root value matches
the documentation of RepoRoot.Root struct field:
// Root is the import path corresponding to the root of the
// repository.
Root string
Fixesgolang/go#7723.
Change-Id: If9f5f55b5751e01a7f88b79d9b039402af3e9312
Reviewed-on: https://go-review.googlesource.com/18461
Reviewed-by: Chris Manghane <cmang@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
...using same logic as in $GOROOT/go/src/cmd/go/discovery.go
See issue #13757
Change-Id: I2ace0abed0743f4a8675fa8780e190d640b57e6c
Reviewed-on: https://go-review.googlesource.com/18196
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
The parser was assuming it would find <body> or </head>.
If the entire response is just <meta> tags, it finds EOF and
treats that as an error. It's not.
This is the same change as in https://golang.org/cl/68520044.
Fixes#9556.
Change-Id: If51ed36e7364c15788311039caf8323eb5fe9a6c
Reviewed-on: https://go-review.googlesource.com/2650
Reviewed-by: Minux Ma <minux@golang.org>
It would be nice to be able to use this package
as a dependency (or other go utilities in the
ecosystem that depend on this package) in
environments which have not (or cannot) for
whatever reason upgraded to newer versions of
golang.
R=golang-dev, adg
CC=golang-dev
https://golang.org/cl/14283043
Add support for logging commands for Mercurial and Subversion as well as the ability to create/log a repo at a certain revision.
- Exported Cmd.LogCmd
- Exported Cmd.CreateAtRev
- Exported Cmd.Log
- Exported Cmd.LogAtRev
R=adg
CC=golang-dev
https://golang.org/cl/13060044
The test would nuke the entire contents of os.TempDir on completion.
This change corrects the code to use ioutil.TempDir.
R=r, adg
CC=golang-dev
https://golang.org/cl/12796045
go/vcs exposes cmd/go/vcs.go from the `go get` command.
- Exported global variables `Verbose` and `ShowCmd` to replace `buildV` and `buildX` from cmd/go/main.go.
- Moved environment building code (envForDir, mergeEnvLists)from cmd/go/main.go to env.go
- Exported Cmd and its methods: Create, Download, Ping, TagSync, and Tags
- Exported ByCmd and FromDir functions for constructing Cmd
- Exported TagCmd
- Exported RepoRoot
- Exported RepoRootForImport* functions for constructing RepoRoot
R=golang-dev, adg, cmang, bradfitz
CC=golang-dev
https://golang.org/cl/12058054