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

Commit 42d3398

Browse files
authored
Merge pull request #1515 from darkowlzz/status-latest-version-type
status: LATEST should be of the same type as VERSION
2 parents d257a63 + 8239ba1 commit 42d3398

File tree

6 files changed

+17
-11
lines changed

6 files changed

+17
-11
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ IMPROVEMENTS:
2929
* Handle errors when writing status output ([#1420](https://github.com/golang/dep/pull/1420))
3030
* Add constraint for locked projects in `status`. (#962)
3131
* Make external config importers error tolerant. ([#1315](https://github.com/golang/dep/pull/1315))
32+
* Show LATEST and VERSION as the same type in status. (#1515)
3233

3334
# v0.3.2
3435

cmd/dep/status.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -570,7 +570,12 @@ func runStatusAll(ctx *dep.Ctx, out outputter, p *dep.Project, sm gps.SourceMana
570570
// upgrade, the first version we encounter that
571571
// matches our constraint will be what we want.
572572
if c.Constraint.Matches(v) {
573-
bs.Latest = v.Revision()
573+
// Latest should be of the same type as the Version.
574+
if bs.Version.Type() == gps.IsSemver {
575+
bs.Latest = v
576+
} else {
577+
bs.Latest = v.Revision()
578+
}
574579
break
575580
}
576581
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +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}]
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}]
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
PROJECT CONSTRAINT VERSION REVISION LATEST PKGS USED
2-
github.com/sdboyer/deptest ^0.8.0 v0.8.0 ff2948a 3f4c3be 1
3-
github.com/sdboyer/deptestdos v2.0.0 v2.0.0 5c60720 5c60720 1
1+
PROJECT CONSTRAINT VERSION REVISION LATEST PKGS USED
2+
github.com/sdboyer/deptest ^0.8.0 v0.8.0 ff2948a v0.8.1 1
3+
github.com/sdboyer/deptestdos v2.0.0 v2.0.0 5c60720 v2.0.0 1
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
PROJECT CONSTRAINT VERSION REVISION LATEST PKGS USED
2-
github.com/sdboyer/deptest v0.8.1 (override) v0.8.1 3f4c3be 3f4c3be 1
3-
github.com/sdboyer/deptestdos v2.0.0 v2.0.0 5c60720 5c60720 1
1+
PROJECT CONSTRAINT VERSION REVISION LATEST PKGS USED
2+
github.com/sdboyer/deptest v0.8.1 (override) v0.8.1 3f4c3be v0.8.1 1
3+
github.com/sdboyer/deptestdos v2.0.0 v2.0.0 5c60720 v2.0.0 1
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
PROJECT CONSTRAINT VERSION REVISION LATEST PKGS USED
2-
github.com/sdboyer/deptest v1.0.0 v1.0.0 ff2948a ff2948a 1
3-
github.com/sdboyer/deptestdos a0196ba a0196ba 1
1+
PROJECT CONSTRAINT VERSION REVISION LATEST PKGS USED
2+
github.com/sdboyer/deptest v1.0.0 v1.0.0 ff2948a v1.0.0 1
3+
github.com/sdboyer/deptestdos a0196ba a0196ba 1

0 commit comments

Comments
 (0)