Skip to content
This repository has been archived by the owner on Sep 9, 2020. It is now read-only.

Commit

Permalink
Merge pull request #1515 from darkowlzz/status-latest-version-type
Browse files Browse the repository at this point in the history
status: LATEST should be of the same type as VERSION
  • Loading branch information
sdboyer authored Jan 16, 2018
2 parents d257a63 + 8239ba1 commit 42d3398
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 11 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ IMPROVEMENTS:
* Handle errors when writing status output ([#1420](https://github.com/golang/dep/pull/1420))
* Add constraint for locked projects in `status`. (#962)
* Make external config importers error tolerant. ([#1315](https://github.com/golang/dep/pull/1315))
* Show LATEST and VERSION as the same type in status. (#1515)

# v0.3.2

Expand Down
7 changes: 6 additions & 1 deletion cmd/dep/status.go
Original file line number Diff line number Diff line change
Expand Up @@ -570,7 +570,12 @@ func runStatusAll(ctx *dep.Ctx, out outputter, p *dep.Project, sm gps.SourceMana
// upgrade, the first version we encounter that
// matches our constraint will be what we want.
if c.Constraint.Matches(v) {
bs.Latest = v.Revision()
// Latest should be of the same type as the Version.
if bs.Version.Type() == gps.IsSemver {
bs.Latest = v
} else {
bs.Latest = v.Revision()
}
break
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
[{"ProjectRoot":"github.com/sdboyer/deptest","Constraint":"^0.8.0","Version":"v0.8.0","Revision":"ff2948a2ac8f538c4ecd55962e919d1e13e74baf","Latest":"3f4c3bea144e112a69bbe5d8d01c1b09a544253f","PackageCount":1},{"ProjectRoot":"github.com/sdboyer/deptestdos","Constraint":"v2.0.0","Version":"v2.0.0","Revision":"5c607206be5decd28e6263ffffdcee067266015e","Latest":"5c607206be5decd28e6263ffffdcee067266015e","PackageCount":1}]
[{"ProjectRoot":"github.com/sdboyer/deptest","Constraint":"^0.8.0","Version":"v0.8.0","Revision":"ff2948a2ac8f538c4ecd55962e919d1e13e74baf","Latest":"v0.8.1","PackageCount":1},{"ProjectRoot":"github.com/sdboyer/deptestdos","Constraint":"v2.0.0","Version":"v2.0.0","Revision":"5c607206be5decd28e6263ffffdcee067266015e","Latest":"v2.0.0","PackageCount":1}]
6 changes: 3 additions & 3 deletions cmd/dep/testdata/harness_tests/status/case1/table/stdout.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
PROJECT CONSTRAINT VERSION REVISION LATEST PKGS USED
github.com/sdboyer/deptest ^0.8.0 v0.8.0 ff2948a 3f4c3be 1
github.com/sdboyer/deptestdos v2.0.0 v2.0.0 5c60720 5c60720 1
PROJECT CONSTRAINT VERSION REVISION LATEST PKGS USED
github.com/sdboyer/deptest ^0.8.0 v0.8.0 ff2948a v0.8.1 1
github.com/sdboyer/deptestdos v2.0.0 v2.0.0 5c60720 v2.0.0 1
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
PROJECT CONSTRAINT VERSION REVISION LATEST PKGS USED
github.com/sdboyer/deptest v0.8.1 (override) v0.8.1 3f4c3be 3f4c3be 1
github.com/sdboyer/deptestdos v2.0.0 v2.0.0 5c60720 5c60720 1
PROJECT CONSTRAINT VERSION REVISION LATEST PKGS USED
github.com/sdboyer/deptest v0.8.1 (override) v0.8.1 3f4c3be v0.8.1 1
github.com/sdboyer/deptestdos v2.0.0 v2.0.0 5c60720 v2.0.0 1
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
PROJECT CONSTRAINT VERSION REVISION LATEST PKGS USED
github.com/sdboyer/deptest v1.0.0 v1.0.0 ff2948a ff2948a 1
github.com/sdboyer/deptestdos a0196ba a0196ba 1
PROJECT CONSTRAINT VERSION REVISION LATEST PKGS USED
github.com/sdboyer/deptest v1.0.0 v1.0.0 ff2948a v1.0.0 1
github.com/sdboyer/deptestdos a0196ba a0196ba 1

0 comments on commit 42d3398

Please sign in to comment.