Rename the lock field "repo" to "source"

This commit is contained in:
Carolyn Van Slyck 2017-03-07 13:47:13 -06:00
Родитель 55422bc13b
Коммит 6ae7723bf3
5 изменённых файлов: 14 добавлений и 14 удалений

Просмотреть файл

@ -32,7 +32,7 @@ type lockedDep struct {
Version string `json:"version,omitempty"` Version string `json:"version,omitempty"`
Branch string `json:"branch,omitempty"` Branch string `json:"branch,omitempty"`
Revision string `json:"revision"` Revision string `json:"revision"`
Repository string `json:"repo,omitempty"` Source string `json:"source,omitempty"`
Packages []string `json:"packages"` Packages []string `json:"packages"`
} }
@ -69,7 +69,7 @@ func readLock(r io.Reader) (*Lock, error) {
id := gps.ProjectIdentifier{ id := gps.ProjectIdentifier{
ProjectRoot: gps.ProjectRoot(ld.Name), ProjectRoot: gps.ProjectRoot(ld.Name),
Source: ld.Repository, Source: ld.Source,
} }
l.P[i] = gps.NewLockedProject(id, v, ld.Packages) l.P[i] = gps.NewLockedProject(id, v, ld.Packages)
} }
@ -97,7 +97,7 @@ func (l *Lock) MarshalJSON() ([]byte, error) {
id := lp.Ident() id := lp.Ident()
ld := lockedDep{ ld := lockedDep{
Name: string(id.ProjectRoot), Name: string(id.ProjectRoot),
Repository: id.Source, Source: id.Source,
Packages: lp.Packages(), Packages: lp.Packages(),
} }

Просмотреть файл

@ -35,7 +35,7 @@ func NewTestProjectContext(h *test.Helper, projectName string) *TestProjectConte
h.Cd(pc.Project.AbsRoot) h.Cd(pc.Project.AbsRoot)
h.Setenv("GOPATH", pc.tempDir) h.Setenv("GOPATH", pc.tempDir)
// Setup a Source Manager // Set up a Source Manager
var err error var err error
pc.Context = &Ctx{GOPATH: pc.tempDir} pc.Context = &Ctx{GOPATH: pc.tempDir}
pc.SourceManager, err = pc.Context.SourceManager() pc.SourceManager, err = pc.Context.SourceManager()

Просмотреть файл

@ -21,7 +21,7 @@ Remove: [
Modify: [ Modify: [
{ {
"name": "github.com/foo/bar", "name": "github.com/foo/bar",
"repo": "+ http://github.example.com/foo/bar", "source": "+ http://github.example.com/foo/bar",
"version": "+ 1.2.0", "version": "+ 1.2.0",
"branch": "- master", "branch": "- master",
"revision": "f24338400f072ef18125ae0fbe6b06fe6d1783e7 -> 2a3a211e171803acb82d1d5d42ceb53228f51751", "revision": "f24338400f072ef18125ae0fbe6b06fe6d1783e7 -> 2a3a211e171803acb82d1d5d42ceb53228f51751",

2
testdata/txn_writer/updated_lock.json поставляемый
Просмотреть файл

@ -3,7 +3,7 @@
"projects": [ "projects": [
{ {
"name": "github.com/foo/bar", "name": "github.com/foo/bar",
"repo": "http://github.example.com/foo/bar", "source": "http://github.example.com/foo/bar",
"version": "1.2.0", "version": "1.2.0",
"revision": "2a3a211e171803acb82d1d5d42ceb53228f51751", "revision": "2a3a211e171803acb82d1d5d42ceb53228f51751",
"packages": [ "packages": [

Просмотреть файл

@ -112,7 +112,7 @@ func (diff *LockDiff) Format() (string, error) {
// TODO(carolynvs) this should be moved to gps // TODO(carolynvs) this should be moved to gps
type LockedProjectDiff struct { type LockedProjectDiff struct {
Name gps.ProjectRoot `json:"name"` Name gps.ProjectRoot `json:"name"`
Source *StringDiff `json:"repo,omitempty"` Source *StringDiff `json:"source,omitempty"`
Version *StringDiff `json:"version,omitempty"` Version *StringDiff `json:"version,omitempty"`
Branch *StringDiff `json:"branch,omitempty"` Branch *StringDiff `json:"branch,omitempty"`
Revision *StringDiff `json:"revision,omitempty"` Revision *StringDiff `json:"revision,omitempty"`