Previously -dump-hashes dumped the current state of the hashes in a format like
the following:
$REPO_NAME $HASH $SUBJECT
While this dumps the relevant information, it is not machine parseable. Instead
in this commit, we dump out the hashes into a update-checkout config json file
with a scheme name of repro. Thus to reproduce the current repository state on
someone else's machine, you don't need to type in the exact hashes. Instead, one
can just do:
```
$ ./swift/utils/update-checkout -dump-hashes > repro.json
```
and then give the repro.json file to another swift developer. They then can run:
```
$ ./swift/utils/update-checkout -config=repro.json -scheme=repro
```
which will checkout all of the appropriate hashes for each repository to
reproduce the build on the other user's machine.
Previously, if a branch scheme did not specify a branch for a repository,
update-checkout would crash. It's implied that all repositories should be
cloned by all schemes, which is not necessarily the case.
Now, repositories not specified in a scheme are not cloned.
Addresses SR-8060.
Without a --scheme, --match-timestamp would only look back in time from the HEAD
of each sibling repository which means those repositories will never go forward
in time when the swift repo does. This is probably not what one wants when, for
instance, bisecting and generally trying to do historical builds. Finding the
--scheme behaviour in the first place is slightly non-obvious, passing that flag
is easy to forget, and the non---scheme behaviour is probably not particularly
useful, so let's just force --scheme to be passed.
Fixes https://bugs.swift.org/browse/SR-7468 and rdar://problem/39520842
As requested in SR-6312 a simple diagnostic to catch the error of not passing --clone the first time you run update-checkout. Checks whether there is just one directory (i.e. the swift/ directory) in SWIFT_SOURCE_ROOT and prints a message.
This allows one to say `./utils/update-checkout --clone --skip-history --scheme swift-3.1-branch`. This would otherwise fail, as it would do a shallow clone of master, which doesn't contain `swift-3.1-branch`.