Automatically adds quotes on Windows when necessary

So that a command like
 "git config rietveld.viewvc-url http://src.chromium.org/viewvc/chrome?view=rev&revision="
works fine.

Fix the description automatically generated for the hooks to be using the same
code than for the one presented to the user.

R=cmp@chromium.org
BUG=
TEST=Tested manually on cygwin, win32, linux


Review URL: https://chromiumcodereview.appspot.com/10447021

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@138874 0039d316-1c4b-4281-b951-d872f2087c98
diff --git a/tests/git_cl_test.py b/tests/git_cl_test.py
index 29e5cc5..4e5bd5d 100755
--- a/tests/git_cl_test.py
+++ b/tests/git_cl_test.py
@@ -112,11 +112,11 @@
         'M\t.gitignore\n'),
       ((['git', 'config', 'branch.master.rietveldissue'],), ''),
       ((['git', 'config', 'branch.master.rietveldpatchset'],), ''),
-      ((['git', 'log', '--pretty=format:%s%n%n%b', 'master...'],), 'foo'),
+      ((['git', 'log', '--pretty=format:%s%n%n%b', 'master..'],), 'foo'),
       ((['git', 'config', 'user.email'],), 'me@example.com'),
       ((['git', 'diff', '--no-ext-diff', '--stat', '-M', 'master...'],),
        '+dat'),
-      ((['git', 'log', '--pretty=format:%s\n\n%b', 'master..'],), 'desc\n'),
+      ((['git', 'log', '--pretty=format:%s%n%n%b', 'master..'],), 'desc\n'),
     ]
 
   @staticmethod
@@ -345,7 +345,7 @@
          'M\t.gitignore\n'),
         ((['git', 'config', 'branch.master.rietveldissue'],), ''),
         ((['git', 'config', 'branch.master.rietveldpatchset'],), ''),
-        ((['git', 'log', '--pretty=format:%s%n%n%b', 'master...'],), 'foo'),
+        ((['git', 'log', '--pretty=format:%s%n%n%b', 'master..'],), 'foo'),
         ((['git', 'config', 'user.email'],), 'me@example.com'),
         ((['git', 'diff', '--no-ext-diff', '--stat', '-M', 'master...'],),
          '+dat'),
@@ -354,7 +354,7 @@
   @staticmethod
   def _gerrit_upload_calls(description, reviewers):
     calls = [
-        ((['git', 'log', '--pretty=format:%s\n\n%b', 'master..'],),
+        ((['git', 'log', '--pretty=format:%s%n%n%b', 'master..'],),
          description),
         ((['git', 'config', 'rietveld.cc'],), '')
         ]