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

Unified Diff: gcl.py

Issue 9298002: Revert 119066 until we have consensus. (Closed) Base URL: svn://chrome-svn/chrome/trunk/tools/depot_tools/
Patch Set: Created 8 years, 11 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 | git_cl.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gcl.py
===================================================================
--- gcl.py (revision 119352)
+++ gcl.py (working copy)
@@ -285,6 +285,7 @@
self.issue = int(issue)
self.patchset = int(patchset)
self._description = None
+ self._subject = None
self._reviewers = None
self._set_description(description)
if files is None:
@@ -309,11 +310,19 @@
parsed_lines = []
reviewers_re = re.compile(REVIEWERS_REGEX)
reviewers = ''
+ subject = ''
for l in description.splitlines():
+ if not subject:
+ subject = l
matched_reviewers = reviewers_re.match(l)
if matched_reviewers:
reviewers = matched_reviewers.group(1).split(',')
parsed_lines.append(l)
+
+ if len(subject) > 100:
+ subject = subject[:97] + '...'
+
+ self._subject = subject
self._reviewers = reviewers
self._description = '\n'.join(parsed_lines)
@@ -323,6 +332,10 @@
def reviewers(self):
return self._reviewers
+ @property
+ def subject(self):
+ return self._subject
+
def NeedsUpload(self):
return self.needs_upload
@@ -846,11 +859,18 @@
desc_file = None
try:
- if change_info.issue:
- # Uploading a new patchset.
+ if change_info.issue: # Uploading a new patchset.
+ found_message = False
+ for arg in args:
+ if arg.startswith("--message") or arg.startswith("-m"):
+ found_message = True
+ break
+
+ if not found_message:
+ upload_arg.append("--message=''")
+
upload_arg.append("--issue=%d" % change_info.issue)
- else:
- # First time we upload.
+ else: # First time we upload.
handle, desc_file = tempfile.mkstemp(text=True)
os.write(handle, change_info.description)
os.close(handle)
@@ -868,7 +888,9 @@
cc_list = ','.join(filter(None, [cc_list] + watchers))
if cc_list:
upload_arg.append("--cc=" + cc_list)
- upload_arg.append("--file=%s" % desc_file)
+ upload_arg.append("--description_file=%s" % desc_file)
+ if change_info.subject:
+ upload_arg.append("--message=" + change_info.subject)
if GetCodeReviewSetting("PRIVATE") == "True":
upload_arg.append("--private")
« no previous file with comments | « no previous file | git_cl.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698