Add the infrastructure necessary to support annotated stdout.

Simplify ExecutionQueue.run() by moving code into utility functions.

Reduce the amount of code in WorkerThread.run() to improve reliability.

Don't trap exceptions in single-threaded usage!

BUG=54084
TEST=none

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@58974 0039d316-1c4b-4281-b951-d872f2087c98
diff --git a/gclient.py b/gclient.py
index d7f0209..650c25a 100644
--- a/gclient.py
+++ b/gclient.py
@@ -334,7 +334,7 @@
           None, should_process))
     logging.debug('Loaded: %s' % str(self))
 
-  def run(self, options, revision_overrides, command, args, work_queue):
+  def run(self, revision_overrides, command, args, work_queue, options):
     """Runs 'command' before parsing the DEPS in case it's a initial checkout
     or a revert."""
     assert self._file_list == []
@@ -720,8 +720,7 @@
     work_queue = gclient_utils.ExecutionQueue(self._options.jobs, pm)
     for s in self.dependencies:
       work_queue.enqueue(s)
-    work_queue.flush(self._options, revision_overrides, command, args,
-        work_queue)
+    work_queue.flush(revision_overrides, command, args, options=self._options)
 
     # Once all the dependencies have been processed, it's now safe to run the
     # hooks.
@@ -765,7 +764,7 @@
     work_queue = gclient_utils.ExecutionQueue(self._options.jobs, None)
     for s in self.dependencies:
       work_queue.enqueue(s)
-    work_queue.flush(self._options, {}, None, [], work_queue)
+    work_queue.flush({}, None, [], options=self._options)
 
     def GetURLAndRev(dep):
       """Returns the revision-qualified SCM url for a Dependency."""