Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(786)

Unified Diff: git_cl.py

Issue 10445042: Revert r138874 "Automatically adds quotes on Windows when necessary" (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/depot_tools
Patch Set: Created 8 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | tests/git_cl_test.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: git_cl.py
diff --git a/git_cl.py b/git_cl.py
index 7fa0c2d31f001401abf512dcf96eae42436de1a1..2c63d7330cafd947151134f864714f77e8e918b6 100755
--- a/git_cl.py
+++ b/git_cl.py
@@ -51,21 +51,9 @@ def DieWithError(message):
sys.exit(1)
-def QuoteCommand(command):
- """Quotes command on Windows so it runs fine even with & and | in the string.
- """
- if sys.platform == 'win32':
- def fix(arg):
- if ('&' in arg or '|' in arg) and '"' not in arg:
- arg = '"%s"' % arg
- return arg
- command = [fix(arg) for arg in command]
- return command
-
-
def RunCommand(args, error_ok=False, error_message=None, **kwargs):
try:
- return subprocess2.check_output(QuoteCommand(args), **kwargs)
+ return subprocess2.check_output(args, shell=False, **kwargs)
except subprocess2.CalledProcessError, e:
if not error_ok:
DieWithError(
@@ -545,7 +533,8 @@ or verify this branch is set up to track another (via the --track argument to
# If the change was never uploaded, use the log messages of all commits
# up to the branch point, as git cl upload will prefill the description
# with these log messages.
- description = CreateDescriptionFromLog([upstream_branch + '..'])
+ description = RunCommand(['git', 'log', '--pretty=format:%s%n%n%b',
+ '%s...' % (upstream_branch)]).strip()
if not author:
author = RunGit(['config', 'user.email']).strip() or None
@@ -890,7 +879,7 @@ def CreateDescriptionFromLog(args):
log_args = [args[0] + '..' + args[1]]
else:
log_args = args[:] # Hope for the best!
- return RunGit(['log', '--pretty=format:%s%n%n%b'] + log_args)
+ return RunGit(['log', '--pretty=format:%s\n\n%b'] + log_args)
def ConvertToInteger(inputval):
« no previous file with comments | « no previous file | tests/git_cl_test.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698