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

Commit

Permalink
fix(status): tableOutput show override constraints
Browse files Browse the repository at this point in the history
Add `hasOverride` attribute to `BasicStatus` struct and use it to append
"(override)" to projects with overridden constraints.

Closes #892
  • Loading branch information
darkowlzz committed Jul 28, 2017
1 parent eb5b757 commit 21abe6a
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion cmd/dep/status.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -250,6 +253,7 @@ type BasicStatus struct {
Revision gps.Revision
Latest gps.Version
PackageCount int
hasOverride bool
}

type MissingStatus struct {
Expand Down Expand Up @@ -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()
Expand Down

0 comments on commit 21abe6a

Please sign in to comment.