Граф коммитов

85 Коммитов

Автор SHA1 Сообщение Дата
sam boyer 877b79325c prune: Remove spurious types, fix tests
All old types are now gone, tests are fixed, and test coverage should be
adequate for emergency purposes.
2018-01-24 16:04:02 -05:00
sam boyer 42ebf4a3d8 prune: Introduce CascadingPruneOptions
This new type defers computation of the actual prune value for a given
project until the method is called, rather than trying to precompute it.
By deferring computation, we retain full fidelity on the original
cascading inputs.

Still a WIP hack - need to clean up, and make everything actually use this.
2018-01-24 14:34:29 -05:00
sam boyer 0368da431f ensure: Absorb dep prune into dep ensure
This merge incorporates the long-running branch that consolidated all
the work related to absorbing dep prune into dep ensure. As of this
commit, dep prune is now a hidden dummy command, and dep ensure does all
the heavy lifting automatically.
2018-01-23 20:05:25 -05:00
Carolyn Van Slyck 7cb0a0cfc2
Import internal/test in all packages with tests
This allows people to run go test ./... -update, without this
in order to do a mass update of golden files you need to run the
update against individual packages which is a huge pain.
2018-01-18 15:14:51 -06:00
sam boyer 30ea01581f misc: Clean up CHANGELOG, add TODO from #1509 2018-01-15 21:38:49 -08:00
sam boyer 4437e02946
Merge pull request #1509 from sttts/sttts-source-urls
Rearrange path validation to allow ports
2018-01-15 21:27:16 -08:00
sam boyer db545146b1 gps: Disable certain bzr tests on Windows
The precise underlying causes of the problem with bzr on Windows is
unclear - it could be just about bzr with Windows, or the version of
bzr, or some underlying system interaction. But it's causing appveyor
tests to erroneously fail, and bzr is so little-used that it's
acceptable to just skip the tests, for now.
2018-01-15 08:01:41 -08:00
sam boyer 249a930709 Rearrange path validation to allow ports 2018-01-04 13:05:50 +01:00
sam boyer bf5b9fc8d8
Merge pull request #1219 from ibrasho-forks/optimize-gps-prune
gps: Refactor prune and filesystem functions
2017-12-18 13:44:55 -05:00
Ibrahim AshShohail cef261f120
gps: add tests for deleteEmptyDirs
Signed-off-by: Ibrahim AshShohail <ibra.sho@gmail.com>
2017-12-14 09:36:51 +03:00
Ibrahim AshShohail c7c3fd83f6
gps: fix a bug that kept empty dirs after pruning
Signed-off-by: Ibrahim AshShohail <ibra.sho@gmail.com>
2017-12-12 11:09:19 +03:00
Ibrahim AshShohail b4fca9bfce
gps: handle symlinks properly
We now delete anything that looks like a symlink if its called
"vendor" while pruning.

Hopefully, you didn't make a bad decision by relying on the magical
properties of symlinks.

Signed-off-by: Ibrahim AshShohail <ibra.sho@gmail.com>
2017-12-11 16:35:06 +03:00
Suhas Karanth 37d6c560cd do not create cachedir recursively
source
- main.go: Try to ensure directory for given `cachedir` path.
- context.go: Create the default cache directory, `$GOPATH/pkg/dep`, if the
  user did not override it.
- source_manager.go: Use `fs.EnsureDir` instead of `os.MkdirAll` for creating
  sources folder in cache directory.
- fs.go:
  - Add func `EnsureDir` to create a directory if it does not exist.
  - Remove func `IsValidPath`.

test
- integration_test.go: Improve tests for invalid cache directory.
- fs_test.go: Add test for `EnsureDir`, remove test for `IsValidPath`.
- manager_test.go: fix TestSourceManagerInit
  - Re-create cache directory before trying to call `NewSourceManager` the 2nd
    time and defer it's removal.
  - If `NewSourceManager` fails the 2nd time, exit the error using `t.Fatal` to
    avoid panic in `sm.Release`

misc
- language - {fallback => default} for cachedir
2017-12-08 09:02:18 +05:30
Suhas Karanth 6c1220894d allow cachedir override using env var
source
- main.go: Read and use env var `DEPCACHEDIR` for instantiating dep context.
- context.go:
  - Add field `Cachedir` to struct `Ctx`. This holds the value of env var
    `DEPCACHEDIR`.
  - Use `Ctx.Cachedir` while instantiating `gps.SourceMgr` if present, fallback
    to `$GOPATH/pkg/dep` otherwise.
- source_manager.go: Add a getter func `Cachedir` to facilitate testing in
  `context_test.go`.

test
- context_test.go Add test to check `gps.SourceMgr` is instantiated with
  appropriate `cachedir`.
- integration_test.go: Add test to check environment variable `DEPCACHEDIR` is
  loaded and used if present.

misc
- update changelog
2017-12-08 09:02:18 +05:30
sam boyer e4d57f7eda gps: Return output buffer bytes on error
This is crude, but it will restore output context to various git errors,
which has been crippling. We desperately need to work on formatting
these errors better.
2017-12-07 19:09:14 -05:00
Ibrahim AshShohail fb9ac8c17a
resolve nits
Signed-off-by: Ibrahim AshShohail <ibra.sho@gmail.com>
2017-12-07 23:49:59 +03:00
Ibrahim AshShohail e113a9be23
fix deriveFilesystemState bug on Windows junctions
Signed-off-by: Ibrahim AshShohail <ibra.sho@gmail.com>
2017-12-05 18:09:13 +03:00
Ibrahim AshShohail 148dfe560d
fix missing populated prune options
Signed-off-by: Ibrahim AshShohail <ibra.sho@gmail.com>
2017-12-05 18:09:07 +03:00
Ibrahim AshShohail 4b351b6b0e
rename TestStripVendorSymlinks to TestPruneVendorSymlinks
Signed-off-by: Ibrahim AshShohail <ibra.sho@gmail.com>
2017-12-05 17:04:11 +03:00
Ibrahim AshShohail a2a7418586
gps: update WriteDepTree to use PruneProject function
Signed-off-by: Ibrahim AshShohail <ibra.sho@gmail.com>
2017-11-29 10:21:56 +04:00
Ibrahim AshShohail 2a1be0fc06
gps: update prune functions to use filesystemState
Signed-off-by: Ibrahim AshShohail <ibra.sho@gmail.com>
2017-11-29 10:21:44 +04:00
Ibrahim AshShohail 869f2d711a
gps: refactor the filesystemState struct
Signed-off-by: Ibrahim AshShohail <ibra.sho@gmail.com>
2017-11-29 09:37:45 +04:00
sam boyer 13df556177
Merge pull request #1243 from carolynvs/gopkgin-v0-panic
gps: fix panic for gopkgin's implicit v0
2017-11-20 13:28:18 -05:00
Ibrahim AshShohail 7ed9049636
dep: update tests for adding prune to manifest
Signed-off-by: Ibrahim AshShohail <ibra.sho@gmail.com>
2017-11-17 10:25:07 +03:00
Ibrahim AshShohail 13aa6fcff1
dep: add prune options to manifests
Signed-off-by: Ibrahim AshShohail <ibra.sho@gmail.com>
2017-11-17 10:25:07 +03:00
sam boyer d0d6602eb1
Merge branch 'master' into gopkgin-v0-panic 2017-11-16 21:59:28 -05:00
sam boyer 91e47eed1f
Merge pull request #1245 from carolynvs/wrap-init-err
cmd/dep: wrap errors returned from init
2017-11-16 21:57:18 -05:00
Vladimir Smirnov b7882f0b43 Add a sanity check for git ls-remote output
This should fix panics for cases where `git ls-remote` contains
unepxected lines (e.x. some extra warnings from ssh)

Related to #1379
2017-11-16 16:52:52 +01:00
sam boyer 2b7a08040e
Merge pull request #1376 from sdboyer/dotgit-file
gps: Insulate against .git as file
2017-11-15 00:42:20 -05:00
sam boyer 6da79c0318 gps: Insulate against .git as file
`git ls-remote` was being run without a current working directory, which
- for some versions of git - has the unfortunate side effect of still
looking for a local .git in the cwd hierarchy, and failing if that .git
is a file instead of a directory (as it might be if the user is working
beneath a git submodule).

This relocates the call to somewhere safer, under gps' control, so that
we've a better (though not foolproof) guarantee of not colliding with a
.git file.

Fixes #1338.
2017-11-15 00:29:58 -05:00
Carolyn Van Slyck cb1f5394d5
gps: fix panic for gopkgin's implicit v0
When v0 is requested, and there are no semver branches/tags,
fallback to the default branch.

See http://labix.org/gopkg.in#VersionZero
2017-11-14 20:16:19 -08:00
Jordan Krage 913f48cf42 gps: un-parallelize tests causing appveyor failures 2017-11-14 12:10:21 -06:00
Carolyn Van Slyck a3ed011e8f
cmd/dep: wrap errors returned from init
In some places, we assume that the error returned
from another call is already wrapped with a clear error message.
These extra wraps make it clear that init failed.
2017-11-14 09:45:31 -08:00
Jordan Krage 8065bb2db9 gps: vcs: suppress git password prompts 2017-11-14 10:31:49 -06:00
tamal e9669650a1 Move gps package out of internal
`gomvpkg -from github.com/golang/dep/internal/gps -to github.com/golang/dep/gps`
2017-11-10 17:02:30 -08:00
Dave Cheney 9ea8489e5e gps: move gps to internal/gps
Fixes #300
Fixes #519
2017-05-10 14:15:27 +10:00
Jordan Krage b6cf7bb8aa Merge branch 'master' into in_process_tests 2017-05-09 08:42:36 -05:00
Jordan Krage 4ec47a6b46 review changes 2017-05-09 08:30:19 -05:00
sam boyer 4c5e4592fc Merge pull request #353 from spenczar/cmd_use_interfaces
Use gps.SourceManager instead of *gps.SourceMgr in cmd/dep
2017-05-08 20:17:14 -04:00
sam boyer e7471866e2 Merge pull request #526 from jmank88/remove_trace_param
gps/solver - Remove SolveParameters.Trace
2017-05-08 19:10:17 -05:00
sam boyer 553fbf0f5e Try sourceHasLatestLocally on revision convert
More generalized solution to #513.
2017-05-08 13:24:29 -05:00
sam boyer 99c6e24238 Ensure local repo exists in bzr/hg before running
This is a quick hack; it needs proper handling in the gateway's FSM.
2017-05-08 13:24:29 -05:00
Jordan Krage b929b9c957 vet: range variable captured by func literal 2017-05-08 08:54:27 -05:00
Jordan Krage 8fccd79af8 sync logging goroutines before completing; reparallelize integration tests 2017-05-08 08:41:52 -05:00
Jordan Krage 3193a3d445 remove SolveParameters.Trace 2017-05-06 17:22:30 -05:00
Jordan Krage d436d09bf0 cleanup 2017-05-06 11:10:16 -05:00
Jordan Krage 8ac72dabc6 restoring Trace solve parameter 2017-05-06 11:06:59 -05:00
Spencer Nelson 25a5016a85 Use gps.SourceManager instead of *gps.SourceMgr 2017-05-06 12:00:25 -04:00
Jordan Krage 8c221e1176 fix example; cleanup 2017-05-06 08:29:52 -05:00
Jordan Krage e50a643805 review changes 2017-05-06 08:23:31 -05:00