Commit c6e39fe4 authored by maruel@chromium.org's avatar maruel@chromium.org

Revert of roll_dep: Avoid large commit messages by providing the log as a link...

Revert of roll_dep: Avoid large commit messages by providing the log as a link (patchset #1 id:1 of https://codereview.chromium.org/1257233006/ )

Reason for revert:
Blink merge is done, blink people won't have to use it anymore.

Original issue's description:
> roll_dep: Avoid large commit messages by providing the log as a link
> 
> The majority of chromium projects are on googlesource.com, which can
> display a range of commits on the web. Use this feature instead of
> dumping logs into the commit message.
> 
> Particularly, this avoids creating large commit messages as these logs
> sometimes contain upwards of 50 commits.
> 
> Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=296184

TBR=jochen@chromium.org,spang@chromium.org
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true

Review URL: https://codereview.chromium.org/1364763002

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@296840 0039d316-1c4b-4281-b951-d872f2087c98
parent 66c8b850
......@@ -17,8 +17,6 @@ import sys
NEED_SHELL = sys.platform.startswith('win')
GITILES_REGEX = r'https?://[^/]*\.googlesource\.com/'
class Error(Exception):
pass
......@@ -88,26 +86,27 @@ def roll(root, deps_dir, key, reviewers, bug):
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()))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment