summaryrefslogtreecommitdiffstats
path: root/WebKitTools/Scripts/webkitpy/tool/steps/postcodereview.py
diff options
context:
space:
mode:
Diffstat (limited to 'WebKitTools/Scripts/webkitpy/tool/steps/postcodereview.py')
-rw-r--r--WebKitTools/Scripts/webkitpy/tool/steps/postcodereview.py29
1 files changed, 14 insertions, 15 deletions
diff --git a/WebKitTools/Scripts/webkitpy/tool/steps/postcodereview.py b/WebKitTools/Scripts/webkitpy/tool/steps/postcodereview.py
index 198cfce..8397519 100644
--- a/WebKitTools/Scripts/webkitpy/tool/steps/postcodereview.py
+++ b/WebKitTools/Scripts/webkitpy/tool/steps/postcodereview.py
@@ -42,33 +42,32 @@ class PostCodeReview(AbstractStep):
def run(self, state):
if not self._options.fancy_review:
return
- # FIXME: This will always be None because we don't retrieve the issue
- # number from the ChangeLog yet.
- codereview_issue = state.get("codereview_issue")
+
+ bug_id = state.get("bug_id")
+ if not bug_id:
+ raise ScriptError(message="Cannot upload a fancy review without a bug ID.")
+
message = self._options.description
if not message:
# If we have an issue number, then the message becomes the label
# of the new patch. Otherwise, it becomes the title of the whole
# issue.
- if codereview_issue:
- message = "Updated patch"
- elif state.get("bug_title"):
+ if state.get("bug_title"):
# This is the common case for the the first "upload" command.
message = state.get("bug_title")
- elif state.get("bug_id"):
+ elif bug_id:
# This is the common case for the "post" command and
- # subsequent runs of the "upload" command. In this case,
- # I'd rather add the new patch to the existing issue, but
- # that's not implemented yet.
- message = "Code review for %s" % self._tool.bugs.bug_url_for_bug_id(state["bug_id"])
+ # subsequent runs of the "upload" command.
+ message = "Code review for %s" % self._tool.bugs.bug_url_for_bug_id(bug_id)
else:
# Unreachable with our current commands, but we might hit
# this case if we support bug-less code reviews.
message = "Code review"
+
+ # Use the bug ID as the rietveld issue number. This means rietveld code reviews
+ # when there are multiple different patches on a bug will be a bit wonky, but
+ # webkit-patch assumes one-patch-per-bug.
created_issue = self._tool.codereview.post(diff=self.cached_lookup(state, "diff"),
message=message,
- codereview_issue=codereview_issue,
+ codereview_issue=bug_id,
cc=self._options.cc)
- if created_issue:
- # FIXME: Record the issue number in the ChangeLog.
- state["codereview_issue"] = created_issue