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

Unified Diff: roll_dep.py

Issue 1390073005: Add --no-merges to roll_dep.py (Closed) Base URL: https://chromium.googlesource.com/chromium/tools/depot_tools.git@master
Patch Set: quote when needed Created 5 years, 2 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: roll_dep.py
diff --git a/roll_dep.py b/roll_dep.py
index 9097b832176dc8df357ef939ad1b7803fc2c7959..cead95dcb163bc7ac1424a0940c8de1f3c478028 100755
--- a/roll_dep.py
+++ b/roll_dep.py
@@ -115,8 +115,11 @@ def roll(root, deps_dir, roll_to, key, reviewers, bug, no_log, log_limit):
upstream_url = check_output(
['git', 'config', 'remote.origin.url'], cwd=full_dir).strip()
log_url = get_log_url(upstream_url, head, roll_to)
+ cmd = [
+ 'git', 'log', commit_range, '--date=short', '--no-merges',
+ ]
logs = check_output(
- ['git', 'log', commit_range, '--date=short', '--format=%ad %ae %s'],
+ cmd + ['--format=%ad %ae %s'], # Args with '=' are automatically quoted.
Johann 2015/10/07 18:20:11 so this is kind of messy because for --arg=<string
M-A Ruel 2015/10/07 18:43:11 IIRC, it works with "" but not ''. Please confirm.
cwd=full_dir)
logs = re.sub(r'(?m)^(\d\d\d\d-\d\d-\d\d [^@]+)@[^ ]+( .*)$', r'\1\2', logs)
Johann 2015/10/07 18:20:11 a potential fix is to rework the regex to remove t
nb_commits = logs.count('\n')
@@ -130,8 +133,8 @@ def roll(root, deps_dir, roll_to, key, reviewers, bug, no_log, log_limit):
log_section = ''
if log_url:
log_section = log_url + '\n\n'
- log_section += '$ git log %s --date=short --format=\'%%ad %%ae %%s\'\n' % (
- commit_range)
+ log_section += '$ %s ' % ' '.join(cmd)
+ log_section += '--format=\'%ad %ae %s\'\n'
Johann 2015/10/07 18:20:11 without the quotes above, the command printed is $
if not no_log and should_show_log(upstream_url):
if logs.count('\n') > log_limit:
# Keep the first N log entries.
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698