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

Unified Diff: roll_dep.py

Issue 513383002: Modify roll_dep's commit message (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/depot_tools
Patch Set: more comments Created 6 years, 4 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 c42d7d76eb8d5d9c214da8dc88512a63ab02d4f3..57a882b0d7915ab17a2f272c21a9af2a9e072308 100755
--- a/roll_dep.py
+++ b/roll_dep.py
@@ -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)
« 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