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

Commit 7367dc9

Browse files
authored
Merge pull request #382 from sdboyer/chase-gps
Update gps to v0.16.0
2 parents b839831 + 00a5b76 commit 7367dc9

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

64 files changed

+5077
-2719
lines changed

Gopkg.lock

Lines changed: 9 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Gopkg.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,4 @@
1717

1818
[[dependencies]]
1919
name = "github.com/sdboyer/gps"
20-
version = ">=0.15.0, <1.0.0"
20+
version = ">=0.16.0, <1.0.0"

analyzer.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ import (
1111
"github.com/sdboyer/gps"
1212
)
1313

14-
type analyzer struct{}
14+
type Analyzer struct{}
1515

16-
func (a analyzer) DeriveManifestAndLock(path string, n gps.ProjectRoot) (gps.Manifest, gps.Lock, error) {
16+
func (a Analyzer) DeriveManifestAndLock(path string, n gps.ProjectRoot) (gps.Manifest, gps.Lock, error) {
1717
// TODO: If we decide to support other tools manifest, this is where we would need
1818
// to add that support.
1919
mf := filepath.Join(path, ManifestName)
@@ -36,6 +36,6 @@ func (a analyzer) DeriveManifestAndLock(path string, n gps.ProjectRoot) (gps.Man
3636
return m, nil, nil
3737
}
3838

39-
func (a analyzer) Info() (string, int) {
39+
func (a Analyzer) Info() (string, int) {
4040
return "dep", 1
4141
}

analyzer_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ func TestDeriveManifestAndLock(t *testing.T) {
2222
want := h.GetTestFileString(golden)
2323
h.TempCopy(filepath.Join("dep", ManifestName), golden)
2424

25-
a := analyzer{}
25+
a := Analyzer{}
2626

2727
m, l, err := a.DeriveManifestAndLock(h.Path("dep"), "my/fake/project")
2828
if err != nil {
@@ -56,7 +56,7 @@ func TestDeriveManifestAndLockDoesNotExist(t *testing.T) {
5656
}
5757
defer os.RemoveAll(dir)
5858

59-
a := analyzer{}
59+
a := Analyzer{}
6060

6161
m, l, err := a.DeriveManifestAndLock(dir, "my/fake/project")
6262
if m != nil || l != nil || err != nil {

cmd/dep/ensure.go

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -309,11 +309,8 @@ func getProjectConstraint(arg string, sm *gps.SourceMgr) (gps.ProjectConstraint,
309309
var found bool
310310
for _, version := range versions {
311311
if versionStr == version.String() {
312-
if pv, ok := version.(gps.PairedVersion); ok {
313-
version = pv.Unpair()
314-
}
315312
found = true
316-
constraint.Constraint = version
313+
constraint.Constraint = version.Unpair()
317314
break
318315
}
319316
}

cmd/dep/init.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,7 @@ func (cmd *initCommand) Run(ctx *dep.Ctx, args []string) error {
141141
RootPackageTree: pkgT,
142142
Manifest: m,
143143
Lock: l,
144+
ProjectAnalyzer: dep.Analyzer{},
144145
}
145146

146147
if *verbose {

cmd/dep/status.go

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -336,21 +336,14 @@ func runStatusAll(out outputter, p *dep.Project, sm *gps.SourceMgr) error {
336336

337337
vl, err := sm.ListVersions(proj.Ident())
338338
if err == nil {
339-
gps.SortForUpgrade(vl)
339+
gps.SortPairedForUpgrade(vl)
340340

341341
for _, v := range vl {
342342
// Because we've sorted the version list for
343343
// upgrade, the first version we encounter that
344344
// matches our constraint will be what we want.
345345
if c.Constraint.Matches(v) {
346-
// For branch constraints this should be the
347-
// most recent revision on the selected
348-
// branch.
349-
if tv, ok := v.(gps.PairedVersion); ok && v.Type() == gps.IsBranch {
350-
bs.Latest = tv.Underlying()
351-
} else {
352-
bs.Latest = v
353-
}
346+
bs.Latest = v.Underlying()
354347
break
355348
}
356349
}

context.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ func NewContext() (*Ctx, error) {
5252
}
5353

5454
func (c *Ctx) SourceManager() (*gps.SourceMgr, error) {
55-
return gps.NewSourceManager(analyzer{}, filepath.Join(c.GOPATH, "pkg", "dep"))
55+
return gps.NewSourceManager(filepath.Join(c.GOPATH, "pkg", "dep"))
5656
}
5757

5858
// LoadProject takes a path and searches up the directory tree for

project.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,8 @@ type Project struct {
5959
// any nils incorrectly.
6060
func (p *Project) MakeParams() gps.SolveParameters {
6161
params := gps.SolveParameters{
62-
RootDir: p.AbsRoot,
62+
RootDir: p.AbsRoot,
63+
ProjectAnalyzer: Analyzer{},
6364
}
6465

6566
if p.Manifest != nil {

vendor/github.com/sdboyer/constext/LICENSE

Lines changed: 21 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/github.com/sdboyer/constext/README.md

Lines changed: 78 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/github.com/sdboyer/constext/constext.go

Lines changed: 123 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)