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

Commit 5d885c9

Browse files
authored
Merge pull request #918 from darkowlzz/892-status-overrides
fix(status): tableOutput show override constraints
2 parents 66e20d5 + fbbac80 commit 5d885c9

File tree

8 files changed

+79
-1
lines changed

8 files changed

+79
-1
lines changed

cmd/dep/status.go

+5-1
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,9 @@ func (out *tableOutput) BasicLine(bs *BasicStatus) {
9595
} else {
9696
constraint = bs.Constraint.String()
9797
}
98+
if bs.hasOverride {
99+
constraint += " (override)"
100+
}
98101
fmt.Fprintf(out.w,
99102
"%s\t%s\t%s\t%s\t%s\t%d\t\n",
100103
bs.ProjectRoot,
@@ -250,6 +253,7 @@ type BasicStatus struct {
250253
Revision gps.Revision
251254
Latest gps.Version
252255
PackageCount int
256+
hasOverride bool
253257
}
254258

255259
// MissingStatus contains information about all the missing packages in a project.
@@ -338,7 +342,7 @@ func runStatusAll(ctx *dep.Ctx, out outputter, p *dep.Project, sm gps.SourceMana
338342
// Check if the manifest has an override for this project. If so,
339343
// set that as the constraint.
340344
if pp, has := p.Manifest.Ovr[proj.Ident().ProjectRoot]; has && pp.Constraint != nil {
341-
// TODO note somehow that it's overridden
345+
bs.hasOverride = true
342346
bs.Constraint = pp.Constraint
343347
} else {
344348
bs.Constraint = gps.Any()

cmd/dep/testdata/harness_tests/status/override_constraint/final/Gopkg.lock

+21
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[[override]]
2+
name = "github.com/sdboyer/deptest"
3+
version = "=0.8.1"

cmd/dep/testdata/harness_tests/status/override_constraint/initial/Gopkg.lock

+21
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[[override]]
2+
name = "github.com/sdboyer/deptest"
3+
version = "=0.8.1"
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
// Copyright 2016 The Go Authors. All rights reserved.
2+
// Use of this source code is governed by a BSD-style
3+
// license that can be found in the LICENSE file.
4+
5+
package main
6+
7+
import (
8+
_ "github.com/sdboyer/deptestdos"
9+
)
10+
11+
func main() {
12+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
PROJECT CONSTRAINT VERSION REVISION LATEST PKGS USED
2+
github.com/sdboyer/deptest * (override) v0.8.1 3f4c3be ff2948a 1
3+
github.com/sdboyer/deptestdos * v2.0.0 5c60720 5c60720 1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"commands": [
3+
["ensure"],
4+
["status"]
5+
],
6+
"error-expected": "",
7+
"vendor-final": [
8+
"github.com/sdboyer/deptest",
9+
"github.com/sdboyer/deptestdos"
10+
]
11+
}

0 commit comments

Comments
 (0)