Modify the output of gclient update, gclient status to only print out
messages when --verbose is specified or when something actually happens.

Also, remove --manually_grab_svn_rev, because we need this to happen all 
the time to get gclient update to shut up if we're comparing against HEAD.
It doesn't look like there are any real side effects of removing this.

An alternative change would be to wrap this behind a --quiet flag.

Note that the change to tests/trychange_unittest.py is an unrelated fix to get
all the tests to pass.

  R=maruel@chromium.org
  TEST=none
  BUG=none

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@28039 0039d316-1c4b-4281-b951-d872f2087c98
diff --git a/gclient_scm.py b/gclient_scm.py
index 553f8f9..ce61681 100644
--- a/gclient_scm.py
+++ b/gclient_scm.py
@@ -250,7 +250,7 @@
       command = ['checkout', url, checkout_path]
       if revision:
         command.extend(['--revision', str(revision)])
-      RunSVNAndGetFileList(command, self._root_dir, file_list)
+      RunSVNAndGetFileList(options, command, self._root_dir, file_list)
       return
 
     # Get the existing scm url and the revision number of the current checkout.
@@ -261,12 +261,12 @@
                                 "and try again." %
                                 checkout_path)
 
-    if options.manually_grab_svn_rev:
-      # Retrieve the current HEAD version because svn is slow at null updates.
-      if not revision:
-        from_info_live = CaptureSVNInfo(from_info['URL'], '.')
-        revision = str(from_info_live['Revision'])
-        rev_str = ' at %s' % revision
+    # Retrieve the current HEAD version because svn is slow at null updates.
+    if not revision:
+      from_info_live = CaptureSVNInfo(from_info['URL'], '.')
+      revision = str(from_info_live['Revision'])
+      rev_str = ' at %s' % revision
+      forced_revision = True
 
     if from_info['URL'] != components[0]:
       to_info = CaptureSVNInfo(url, '.')
@@ -308,7 +308,7 @@
         command = ['checkout', url, checkout_path]
         if revision:
           command.extend(['--revision', str(revision)])
-        RunSVNAndGetFileList(command, self._root_dir, file_list)
+        RunSVNAndGetFileList(options, command, self._root_dir, file_list)
         return
 
 
@@ -322,7 +322,7 @@
     command = ["update", checkout_path]
     if revision:
       command.extend(['--revision', str(revision)])
-    RunSVNAndGetFileList(command, self._root_dir, file_list)
+    RunSVNAndGetFileList(options, command, self._root_dir, file_list)
 
   def revert(self, options, args, file_list):
     """Reverts local modifications. Subversion specific.
@@ -372,7 +372,8 @@
 
     # svn revert is so broken we don't even use it. Using
     # "svn up --revision BASE" achieve the same effect.
-    RunSVNAndGetFileList(['update', '--revision', 'BASE'], path, file_list)
+    RunSVNAndGetFileList(options, ['update', '--revision', 'BASE'], path, 
+                         file_list)
 
   def runhooks(self, options, args, file_list):
     self.status(options, args, file_list)
@@ -389,7 +390,7 @@
             % (' '.join(command), path))
       # There's no file list to retrieve.
     else:
-      RunSVNAndGetFileList(command, path, file_list)
+      RunSVNAndGetFileList(options, command, path, file_list)
 
   def pack(self, options, args, file_list):
     """Generates a patch file which can be applied to the root of the
@@ -483,7 +484,7 @@
                           stderr=stderr).communicate()[0]
 
 
-def RunSVNAndGetFileList(args, in_directory, file_list):
+def RunSVNAndGetFileList(options, args, in_directory, file_list):
   """Runs svn checkout, update, or status, output to stdout.
 
   The first item in args must be either "checkout", "update", or "status".
@@ -493,6 +494,7 @@
   sys.stdout as in RunSVN.
 
   Args:
+    options: command line options to gclient
     args: A sequence of command line parameters to be passed to svn.
     in_directory: The directory where svn is to be run.
 
@@ -532,7 +534,7 @@
 
   RunSVNAndFilterOutput(args,
                         in_directory,
-                        True,
+                        options.verbose,
                         True,
                         CaptureMatchingLines)