зеркало из https://github.com/golang/dep.git
Merge pull request #326 from carolynvs/rename-repo-to-source
Rename the lock field "repo" to "source"
This commit is contained in:
Коммит
7cfca5bb9c
20
lock.go
20
lock.go
|
@ -28,12 +28,12 @@ type rawLock struct {
|
||||||
}
|
}
|
||||||
|
|
||||||
type lockedDep struct {
|
type lockedDep struct {
|
||||||
Name string `json:"name"`
|
Name string `json:"name"`
|
||||||
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"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func readLock(r io.Reader) (*Lock, error) {
|
func readLock(r io.Reader) (*Lock, error) {
|
||||||
|
@ -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)
|
||||||
}
|
}
|
||||||
|
@ -96,9 +96,9 @@ func (l *Lock) MarshalJSON() ([]byte, error) {
|
||||||
for k, lp := range l.P {
|
for k, lp := range l.P {
|
||||||
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(),
|
||||||
}
|
}
|
||||||
|
|
||||||
v := lp.Version()
|
v := lp.Version()
|
||||||
|
|
|
@ -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",
|
||||||
|
|
|
@ -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"`
|
||||||
|
|
Загрузка…
Ссылка в новой задаче