From 7cdb8f6632a880b26c40eac8f4dcc81f57c6c73b Mon Sep 17 00:00:00 2001 From: Sunny Date: Sun, 6 Aug 2017 23:19:18 +0530 Subject: [PATCH] fix(status): add constraint for locked projects Use project lock to get the constraints of projects not in manifest. --- cmd/dep/status.go | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/cmd/dep/status.go b/cmd/dep/status.go index 02c14e426c..59b49c1f54 100644 --- a/cmd/dep/status.go +++ b/cmd/dep/status.go @@ -352,11 +352,13 @@ func runStatusAll(ctx *dep.Ctx, out outputter, p *dep.Project, sm gps.SourceMana if bs.Version != nil && bs.Version.Type() != gps.IsVersion { c, has := p.Manifest.Constraints[proj.Ident().ProjectRoot] if !has { - c.Constraint = gps.Any() + // Get constraint for locked project + for _, lockedP := range p.Lock.P { + if lockedP.Ident().ProjectRoot == proj.Ident().ProjectRoot { + c.Constraint = lockedP.Version() + } + } } - // TODO: This constraint is only the constraint imposed by the - // current project, not by any transitive deps. As a result, - // transitive project deps will always show "any" here. bs.Constraint = c.Constraint vl, err := sm.ListVersions(proj.Ident())