From 5b574d5b5755fb4e78307bbe4f1b1d3447c6a1df Mon Sep 17 00:00:00 2001 From: Sunny Date: Fri, 28 Jul 2017 20:12:27 +0530 Subject: [PATCH] fix(status): tableOutput show override constraints Add `hasOverride` attribute to `BasicStatus` struct and use it to append "(override)" to projects with overridden constraints. Closes #892 --- cmd/dep/status.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/cmd/dep/status.go b/cmd/dep/status.go index 02c14e426c..0c39040366 100644 --- a/cmd/dep/status.go +++ b/cmd/dep/status.go @@ -95,6 +95,9 @@ func (out *tableOutput) BasicLine(bs *BasicStatus) { } else { constraint = bs.Constraint.String() } + if bs.hasOverride { + constraint += "(override)" + } fmt.Fprintf(out.w, "%s\t%s\t%s\t%s\t%s\t%d\t\n", bs.ProjectRoot, @@ -250,6 +253,7 @@ type BasicStatus struct { Revision gps.Revision Latest gps.Version PackageCount int + hasOverride bool } // 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 // Check if the manifest has an override for this project. If so, // set that as the constraint. if pp, has := p.Manifest.Ovr[proj.Ident().ProjectRoot]; has && pp.Constraint != nil { - // TODO note somehow that it's overridden + bs.hasOverride = true bs.Constraint = pp.Constraint } else { bs.Constraint = gps.Any()