Commit 8eec89c2 authored by borenet@google.com's avatar borenet@google.com

Modify roll_dep's commit message

This conforms to the convention of using a single-line short description
followed by an empty line followed by a long description. Shortened the
revisions to more easily fit on one line.

BUG=408700

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@291743 0039d316-1c4b-4281-b951-d872f2087c98
parent e6896b58
......@@ -27,6 +27,18 @@ from textwrap import dedent
SHA1_RE = re.compile('^[a-fA-F0-9]{40}$')
GIT_SVN_ID_RE = re.compile('^git-svn-id: .*@([0-9]+) .*$')
ROLL_DESCRIPTION_STR = '''Roll %s from %s to %s
Summary of changes available at:
%s
'''
def shorten_dep_path(dep):
"""Shorten the given dep path if necessary."""
while len(dep) > 31:
dep = '.../' + dep.lstrip('./').partition('/')[2]
return dep
def posix_path(path):
......@@ -248,12 +260,8 @@ def generate_commit_message(deps_section, dep_name, new_rev):
if url.endswith('.git'):
url = url[:-4]
url += '/+log/%s..%s' % (old_rev[:12], new_rev[:12])
return dedent('''\
Rolled %s
from revision %s
to revision %s
Summary of changes available at:
%s\n''' % (dep_name, old_rev, new_rev, url))
return dedent(ROLL_DESCRIPTION_STR % (
shorten_dep_path(dep_name), old_rev[:12], new_rev[:12], url))
def update_deps_entry(deps_lines, deps_ast, value_node, new_rev, comment):
line_idx = update_node(deps_lines, deps_ast, value_node, new_rev)
......
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