Prepare to make --revision <number> to be an error when multiple solutions are present.

It will help catch issues like the one we are getting on linux_chromeos where
the ordering of the solution is now by name, causing the default solution to be
used for --revision being the wrong one.

R=dpranke@chromium.org
BUG=
TEST=


Review URL: http://codereview.chromium.org/8276020

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@105387 0039d316-1c4b-4281-b951-d872f2087c98
diff --git a/gclient.py b/gclient.py
index 2b9b04d..27d2ed1 100644
--- a/gclient.py
+++ b/gclient.py
@@ -847,6 +847,17 @@
     client = GClient(path, options)
     client.SetConfig(gclient_utils.FileRead(
         os.path.join(path, options.config_filename)))
+
+    if (options.revisions and
+        len(client.dependencies) > 1 and
+        any('@' not in r for r in options.revisions)):
+      print >> sys.stderr, (
+          'You must specify the full solution name like --revision %s@%s\n'
+          'when you have multiple solutions setup in your .gclient file.\n'
+          'Other solutions present are: %s.') % (
+              client.dependencies[0].name,
+              options.revisions[0],
+              ', '.join(s.name for s in client.dependencies[1:]))
     return client
 
   def SetDefaultConfig(self, solution_name, deps_file, solution_url,