Auto merge of #4684 - matklad:lazy-update, r=alexcrichton
authorbors <bors@rust-lang.org>
Tue, 31 Oct 2017 14:14:46 +0000 (14:14 +0000)
committerbors <bors@rust-lang.org>
Tue, 31 Oct 2017 14:14:46 +0000 (14:14 +0000)
Don't update lockfiles from previous Cargo versions if `--locked` is passed

Recently, we've stopped outputting `[root]` section to Cargo.lock files. The problem with this is that somebody might want to have a Cargo.lock file with a `[root]` section for compatibility with older Cargos, but at the same time use newer Cargo to build the crate. In this case, newer Cargo would remove `[root]` from the lockfile. Such updating of the lockfiles to the latest versions is a reasonable behavior, but it might be useful to be able to override it with `--locked` flag.

Context: https://github.com/rust-lang/cargo/issues/4563#issuecomment-340238773

r? @alexcrichton


Trivial merge