jiri: When importing a project with a root, prepend the root to the project name.

Consider two manifest, "foo" and "bar", both of which import manifest
"baz".  It should be possible to import both "foo" and "bar" manifests
under different roots, and end up with two copies of the projects in
"baz", under different roots.

This is not currently possible, because jiri enforces that project Keys
be unique, and the project Key contains only the name and remote.

This CL changes jiri import semantics such that when importing a
manifest with a root, all of the projects listed in that manifest will
have the root prepended to their names.

Thus, in the example above, the projects in the "baz" manifest will end
up with different names, and will be treated as unique by jiri.

Change-Id: I5c413bc4a249fdb8f318a2ba645fcd3403829a32
diff --git a/project/project.go b/project/project.go
index c67f63e..310ca28 100644
--- a/project/project.go
+++ b/project/project.go
@@ -1556,6 +1556,7 @@
 	// Process remote imports.
 	for _, remote := range m.Imports {
 		nextRoot := filepath.Join(root, remote.Root)
+		remote.Name = filepath.Join(nextRoot, remote.Name)
 		key := remote.ProjectKey()
 		p, ok := ld.localProjects[key]
 		if !ok {
@@ -1604,6 +1605,8 @@
 	for _, project := range m.Projects {
 		// Make paths absolute by prepending JIRI_ROOT/<root>.
 		project.absolutizePaths(filepath.Join(jirix.Root, root))
+		// Prepend the root to the project name.  This will be a noop if the import is not rooted.
+		project.Name = filepath.Join(root, project.Name)
 		key := project.Key()
 		if dup, ok := ld.Projects[key]; ok && dup != project {
 			// TODO(toddw): Tell the user the other conflicting file.