Upstream version 9.38.198.0
[platform/framework/web/crosswalk.git] / src / v8 / tools / push-to-trunk / chromium_roll.py
index ef9b8bf..0138ff8 100755 (executable)
@@ -30,7 +30,8 @@ class DetectLastPush(Step):
   MESSAGE = "Detect commit ID of last push to trunk."
 
   def RunStep(self):
-    self["last_push"] = self._options.last_push or self.FindLastTrunkPush()
+    self["last_push"] = self._options.last_push or self.FindLastTrunkPush(
+        include_patches=True)
     self["trunk_revision"] = self.GitSVNFindSVNRev(self["last_push"])
     self["push_title"] = self.GitLog(n=1, format="%s",
                                      git_hash=self["last_push"])
@@ -89,7 +90,7 @@ class UploadCL(Step):
                   deps)
     TextToFile(deps, self.Config(DEPS_FILE))
 
-    if self._options.reviewer:
+    if self._options.reviewer and not self._options.manual:
       print "Using account %s for review." % self._options.reviewer
       rev = self._options.reviewer
     else:
@@ -98,9 +99,14 @@ class UploadCL(Step):
       rev = self.ReadLine()
 
     commit_title = "Update V8 to %s." % self["push_title"].lower()
-    self.GitCommit("%s\n\nTBR=%s" % (commit_title, rev))
+    sheriff = ""
+    if self["sheriff"]:
+      sheriff = ("\n\nPlease reply to the V8 sheriff %s in case of problems."
+                 % self["sheriff"])
+    self.GitCommit("%s%s\n\nTBR=%s" % (commit_title, sheriff, rev))
     self.GitUpload(author=self._options.author,
-                   force=self._options.force_upload)
+                   force=self._options.force_upload,
+                   cq=self._options.use_commit_queue)
     print "CL uploaded."
 
 
@@ -138,6 +144,9 @@ class ChromiumRoll(ScriptsBase):
                               "directory to automate the V8 roll."))
     parser.add_argument("-l", "--last-push",
                         help="The git commit ID of the last push to trunk.")
+    parser.add_argument("--use-commit-queue",
+                        help="Check the CQ bit on upload.",
+                        default=False, action="store_true")
 
   def _ProcessOptions(self, options):  # pragma: no cover
     if not options.manual and not options.reviewer:
@@ -158,6 +167,7 @@ class ChromiumRoll(ScriptsBase):
       Preparation,
       DetectLastPush,
       CheckChromium,
+      DetermineV8Sheriff,
       SwitchChromium,
       UpdateChromiumCheckout,
       UploadCL,