Merge lp:~rogpeppe/godeps/002-multi-dependency-update into lp:godeps
| Status: | Needs review |
|---|---|
| Proposed branch: | lp:~rogpeppe/godeps/002-multi-dependency-update |
| Merge into: | lp:godeps |
| Diff against target: |
234 lines (+134/-14) 1 file modified
godeps.go (+134/-14) |
| To merge this branch: | bzr merge lp:~rogpeppe/godeps/002-multi-dependency-update |
| Related bugs: |
| Reviewer | Review Type | Date Requested | Status |
|---|---|---|---|
| godeps-maintainers | 2015-01-27 | Pending | |
|
Review via email:
|
|||
Description of the Change
allow updating dependencies from multiple files
When there's a conflict, it prints a warning and
tries to choose the dependency from the earliest-specified
file or latest revision depending on command line flags.
Also changed the behaviour of the -n flag
so that it does not overlap so much with -x
and so that we don't see so much noise when experimenting
with godeps -u commands.
| Roger Peppe (rogpeppe) wrote : | # |
| Matthew Williams (mattyw) wrote : | # |
Some small comments from me
https:/
File godeps.go (right):
https:/
godeps.go:43: godeps -U [flags] file...
There should be more information about how it works in the usage
message.
e.g.
-U takes multiple dependency files, any common dependcies will be
updated to the latest revision
https:/
godeps.go:776: fmt.Printf(
%v", i0.revno, err0)
So if we can't parse a revision id we always assume that i0 is the
latest. What situations is this likely to fail? I can't help but think
we should return an error at this point. We then have the choice of
stopping the whole thing - or skipping this project and printing a
warning. It feels a bit consistent otherwise.
If we left it like this the usage would be:
-U takes multiple dependency files, any common dependcies will be
updated to the
latest revision. If a particular revid can't be parsed we assume the
first revid we find is the one we want. This means the list of
dependency files can be effectively ordered from most important -> least
important
- 29. By Roger Peppe on 2015-01-27
-
add latest flag, docs; change -dryrun behaviour slightly
| Roger Peppe (rogpeppe) wrote : | # |
Please take a look.
| Roger Peppe (rogpeppe) wrote : | # |
Please take a look.
https:/
File godeps.go (right):
https:/
godeps.go:43: godeps -U [flags] file...
On 2015/01/27 10:51:26, mattyw wrote:
> There should be more information about how it works in the usage
message.
> e.g.
> -U takes multiple dependency files, any common dependcies will be
updated to the
> latest revision
Done.
https:/
godeps.go:776: fmt.Printf(
%v", i0.revno, err0)
On 2015/01/27 10:51:26, mattyw wrote:
> So if we can't parse a revision id we always assume that i0 is the
latest.
That's not quite right. If we can't parse a revision id, we assume that
the one that parses OK is the latest. If we can't parse either of them,
we always return false.
> What
> situations is this likely to fail? I can't help but think we should
return an
> error at this point. We then have the choice of stopping the whole
thing - or
> skipping this project and printing a warning. It feels a bit
consistent
> otherwise.
> If we left it like this the usage would be:
> -U takes multiple dependency files, any common dependcies will be
updated to the
> latest revision. If a particular revid can't be parsed we assume the
first revid
> we find is the one we want. This means the list of dependency files
can be
> effectively ordered from most important -> least important
I think this is a good idea. I have now changed the behaviour so that by
default
it uses the earliest revision file stated, which makes it easy to update
a bunch
of projects while keeping deps for a particular project intact.
Unfortunately if this is desired (for example we want to give juju-core
deps precedence), there's nothing to stop the highest-precedence project
itself being updated. We have
potential cyclic project dependencies here, and updating dependencies
can
affect the dependency graph itself. Some thought is required.
I've also added a -latest flag to enable the previous behaviour
(updating
to latest dependencies), which will also be useful, I think.
| Matthew Williams (mattyw) wrote : | # |
two small nitpicks - otherwise LGTM
https:/
File godeps.go (right):
https:/
godeps.go:65: a warning will be printed and godeps will choose the
first dependency
two spaces between and godeps
https:/
godeps.go:781: func laterIntRevno(i0, i1 VCSInfo) bool {
I'd quite like a TODO here (or near the top) stating the reasons in your
explanation for leaving this as it is. Just as a reminder in case no one
thinks about this issue for 6 months.
Unmerged revisions
- 29. By Roger Peppe on 2015-01-27
-
add latest flag, docs; change -dryrun behaviour slightly
- 28. By Roger Peppe on 2015-01-27
-
godeps: allow multiple dependency files to be updated

Reviewers: mp+247684_ code.launchpad. net,
Message:
Please take a look.
Description:
allow updating dependencies from multiple files
When there's a conflict, it prints a warning and
tries to choose the latest dependency.
https:/ /code.launchpad .net/~rogpeppe/ godeps/ 002-multi- dependency- update/ +merge/ 247684
(do not edit description out of merge proposal)
Please review this at https:/ /codereview. appspot. com/197110043/
Affected files (+121, -9 lines):
A [revision details]
M godeps.go