Made setup_chromeos not checkout the latest branch. It simply
 checks out the latest tag now.
 Also made it use -j<n> where n = #procs + 1. It used to slow my machine
 a lot.

PRESUBMIT=passed
R=raymes,bjanakiraman
DELTA=12  (1 added, 6 deleted, 5 changed)
OCL=49260-p2
RCL=49265-p2
RDATE=2011/03/01 18:32:37


P4 change: 42617208
diff --git a/v14/setup_chromeos.py b/v14/setup_chromeos.py
index 01b201f..9257337 100755
--- a/v14/setup_chromeos.py
+++ b/v14/setup_chromeos.py
@@ -11,6 +11,7 @@
 __author__ = "raymes@google.com (Raymes Khoury)"
 
 import getpass
+import multiprocessing
 import optparse
 import os
 import sys
@@ -111,11 +112,6 @@
 
   directory = options.directory.strip()
 
-  if version == "top":
-    branch = "master"
-  else:
-    branch = ".".join(version.split(".")[0:-1]) + ".B"
-
   # Don't checkout chrome sources outside the chroot at the moment.
   # If we check them out outside, we can't do some things, like build tests.
   checkout_chrome_outside_chroot = False
@@ -127,12 +123,11 @@
   commands.append("mkdir -p " + directory)
   commands.append("cd " + directory)
   commands.append("repo init -u "
-                  "ssh://git@gitrw.chromium.org:9222/manifest-internal -b "
-                  + branch + minilayout)
-  commands.append("repo sync -j10")
-  if branch != "master":
-    commands.append("repo forall -c 'git checkout -f -b %s %s'"
-                    % (branch, version))
+                  "ssh://git@gitrw.chromium.org:9222/manifest-internal"
+                  + minilayout)
+  commands.append("repo sync -j" + str(multiprocessing.cpu_count() + 1))
+  if version != "top":
+    commands.append("repo forall -c 'git checkout -f %s'" % version)
   cmd_executer.RunCommands(commands)
 
   # Setup svn credentials for use inside the chroot