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

Unified Diff: drover.py

Issue 12656003: Make drover produce git friendly titles. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/depot_tools
Patch Set: Created 7 years, 9 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: drover.py
diff --git a/drover.py b/drover.py
index b806eda30da310f926ac63b4010b6403326f605b..22e9b7d790609371338fc71a23224fe7900e7fc9 100755
--- a/drover.py
+++ b/drover.py
@@ -595,10 +595,19 @@ def drover(options, args):
filename = str(revision)+".txt"
out = open(filename,"w")
- out.write(action +" " + str(revision) + "\n")
- for line in getRevisionLog(url, revision).splitlines():
+ drover_title = '%s %s' % (action, revision)
+ revision_log = getRevisionLog(url, revision).splitlines()
+ if revision_log:
+ commit_title = revision_log[0]
+ # Limit title to 68 chars so git log --oneline is <80 chars.
+ max_commit_title = 68 - (len(drover_title) + 3)
+ if len(commit_title) > max_commit_title:
+ commit_title = commit_title[:max_commit_title-3] + '...'
+ drover_title += ' "%s"' % commit_title
+ out.write(drover_title + '\n\n')
+ for line in revision_log:
out.write('> %s\n' % line)
- if (author):
+ if author:
out.write("\nTBR=" + author)
out.close()
« 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