jiri: Add remote imports logic, and jiri import and upgrade cmds.

This CL adds the ability to import multiple manifest
repositories, via a mechanism called "remote imports".  In
addition it adds new commands "jiri import" and "jiri upgrade",
which help manage things in the new world.  The usage of "jiri
upgrade" explains what's happening:

The old (deprecated) behavior only allowed a single manifest
repository, located in $JIRI_ROOT/.manifest.  The initial
manifest file is located as follows:
1) Use -manifest flag, if non-empty.  If it's empty...
2) Use $JIRI_ROOT/.local_manifest file.  If it doesn't exist...
3) Use $JIRI_ROOT/.manifest/v2/default.

The new behavior allows multiple manifest repositories, by
allowing imports to specify project attributes describing the
remote repository.  The -manifest flag is no longer allowed to be
set; the initial manifest file is always located in
$JIRI_ROOT/.jiri_manifest.  The .local_manifest file is ignored.

During the transition phase, both old and new behaviors are
supported.  The jiri tool uses the existence of the
$JIRI_ROOT/.jiri_manifest file as the signal; if it exists we run
the new behavior, otherwise we run the old behavior.  The -revert
flag simply deletes the .jiri_manifest file.

The new behavior includes a "jiri import" command, which writes
or updates the .jiri_manifest file.  The new bootstrap procedure
runs "jiri import", and it is intended as a regular command to
add imports to your jiri environment.

The upgrade command eases the transition by writing an initial
.jiri_manifest file for you.  If you have an existing
.local_manifest file, its contents will be incorporated into the
new .jiri_manifest file.

MultiPart: 1/2

Change-Id: I26bfc1d0928ad3979bdf1ea4bf8238e9b081f0c9
13 files changed