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 #918 from darkowlzz/892-status-overrides
Browse files Browse the repository at this point in the history
fix(status): tableOutput show override constraints
  • Loading branch information
darkowlzz authored Aug 12, 2017
2 parents 66e20d5 + fbbac80 commit 5d885c9
Show file tree
Hide file tree
Showing 8 changed files with 79 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
}

// MissingStatus contains information about all the missing packages in a project.
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

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[[override]]
name = "github.com/sdboyer/deptest"
version = "=0.8.1"

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[[override]]
name = "github.com/sdboyer/deptest"
version = "=0.8.1"
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
// Copyright 2016 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

package main

import (
_ "github.com/sdboyer/deptestdos"
)

func main() {
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
PROJECT CONSTRAINT VERSION REVISION LATEST PKGS USED
github.com/sdboyer/deptest * (override) v0.8.1 3f4c3be ff2948a 1
github.com/sdboyer/deptestdos * v2.0.0 5c60720 5c60720 1
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"commands": [
["ensure"],
["status"]
],
"error-expected": "",
"vendor-final": [
"github.com/sdboyer/deptest",
"github.com/sdboyer/deptestdos"
]
}

0 comments on commit 5d885c9

Please sign in to comment.