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

Unified Diff: roll_dep.py

Issue 1364763002: Revert of roll_dep: Avoid large commit messages by providing the log as a link (Closed) Base URL: https://chromium.googlesource.com/chromium/tools/depot_tools.git@master
Patch Set: Created 5 years, 3 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 c3c80b19d12081d747ad7f2287ecd95bba4287d5..164bd57d4b76bbc63384b4ae85f3e82227dfa655 100755
--- a/roll_dep.py
+++ b/roll_dep.py
@@ -16,8 +16,6 @@
import sys
NEED_SHELL = sys.platform.startswith('win')
-
-GITILES_REGEX = r'https?://[^/]*\.googlesource\.com/'
class Error(Exception):
@@ -88,26 +86,27 @@
raise Error('No revision to roll!')
commit_range = '%s..%s' % (head[:9], master[:9])
- upstream_url = check_output(
- ['git', 'config', 'remote.origin.url'], cwd=full_dir).strip()
- log_url = None
- if re.match(GITILES_REGEX, upstream_url):
- log_url = '%s/+log/%s..%s' % (upstream_url, head, master)
-
- msg_args = {
- 'deps_dir': deps_dir,
- 'commit_range': commit_range,
- 'log': '%s\n\n' % log_url if log_url else '',
- 'reviewer': 'R=%s\n' % ','.join(reviewers) if reviewers else '',
- 'bug': 'BUG=%s\n' % bug if bug else '',
- }
+ logs = check_output(
+ ['git', 'log', commit_range, '--date=short', '--format=%ad %ae %s'],
+ cwd=full_dir).strip()
+ logs = re.sub(r'(?m)^(\d\d\d\d-\d\d-\d\d [^@]+)@[^ ]+( .*)$', r'\1\2', logs)
+ cmd = 'git log %s --date=short --format=\'%%ad %%ae %%s\'' % commit_range
+ reviewer = 'R=%s\n' % ','.join(reviewers) if reviewers else ''
+ bug = 'BUG=%s\n' % bug if bug else ''
msg = (
- 'Roll %(deps_dir)s %(commit_range)s\n'
+ 'Roll %s/ to %s.\n'
'\n'
- '%(log)s'
- '%(reviewer)s'
- '%(bug)s' % msg_args)
+ '$ %s\n'
+ '%s\n\n'
+ '%s'
+ '%s') % (
+ deps_dir,
+ master,
+ cmd,
+ logs,
+ reviewer,
+ bug)
print('Commit message:')
print('\n'.join(' ' + i for i in msg.splitlines()))
« 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