Reviewers: jarin,

Message:
PTAL

Description:
Make auto-roll script also roll patched trunk revisions.

BUG=

Please review this at https://codereview.chromium.org/223863003/

SVN Base: https://v8.googlecode.com/svn/branches/bleeding_edge

Affected files (+12, -7 lines):
  M tools/push-to-trunk/auto_roll.py
  M tools/push-to-trunk/chromium_roll.py
  M tools/push-to-trunk/common_includes.py
  M tools/push-to-trunk/test_scripts.py


Index: tools/push-to-trunk/auto_roll.py
diff --git a/tools/push-to-trunk/auto_roll.py b/tools/push-to-trunk/auto_roll.py index e6642f9106747e6367693e5e4a0f10542202802d..567f23b0fe8a59df321dc1d62d71b4bf31eb296a 100755
--- a/tools/push-to-trunk/auto_roll.py
+++ b/tools/push-to-trunk/auto_roll.py
@@ -47,7 +47,7 @@ class DetectLastPush(Step):
   MESSAGE = "Detect commit ID of the last push to trunk."

   def RunStep(self):
-    push_hash = self.FindLastTrunkPush()
+    push_hash = self.FindLastTrunkPush(include_patches=True)
     self["last_push"] = self.GitSVNFindSVNRev(push_hash)


Index: tools/push-to-trunk/chromium_roll.py
diff --git a/tools/push-to-trunk/chromium_roll.py b/tools/push-to-trunk/chromium_roll.py index ef9b8bf38b920d684b464ba9d868c022b4cd80be..adae11d0498e05ed1dee13ff03026288a9daf71c 100755
--- a/tools/push-to-trunk/chromium_roll.py
+++ b/tools/push-to-trunk/chromium_roll.py
@@ -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"])
Index: tools/push-to-trunk/common_includes.py
diff --git a/tools/push-to-trunk/common_includes.py b/tools/push-to-trunk/common_includes.py index 6368a279f2309dc5ee2409cf0764fe3c5c6de8df..efea54a0998a71986a1be5c334fbcafde20820e8 100644
--- a/tools/push-to-trunk/common_includes.py
+++ b/tools/push-to-trunk/common_includes.py
@@ -442,8 +442,12 @@ class Step(GitRecipesMixin):
     except GitFailedException:
       self.WaitForResolvingConflicts(patch_file)

-  def FindLastTrunkPush(self, parent_hash=""):
- push_pattern = "^Version [[:digit:]]*\.[[:digit:]]*\.[[:digit:]]* (based"
+  def FindLastTrunkPush(self, parent_hash="", include_patches=False):
+    push_pattern = "^Version [[:digit:]]*\.[[:digit:]]*\.[[:digit:]]*"
+    if not include_patches:
+ # Non-patched versions only have three numbers followed by the "(based
+      # on...) comment."
+      push_pattern += " (based"
     branch = "" if parent_hash else "svn/trunk"
     return self.GitLog(n=1, format="%H", grep=push_pattern,
                        parent_hash=parent_hash, branch=branch)
Index: tools/push-to-trunk/test_scripts.py
diff --git a/tools/push-to-trunk/test_scripts.py b/tools/push-to-trunk/test_scripts.py index 6fd30c741d44a7b42934447d34629542748cdfba..bd19253b269a03cd2e2738283d363e1119696634 100644
--- a/tools/push-to-trunk/test_scripts.py
+++ b/tools/push-to-trunk/test_scripts.py
@@ -784,7 +784,7 @@ Performance and stability improvements on all platforms.""", commit)
       Git("status -s -b -uno", "## some_branch\n"),
       Git("svn fetch", ""),
       Git(("log -1 --format=%H --grep="
-           "\"^Version [[:digit:]]*\.[[:digit:]]*\.[[:digit:]]* (based\" "
+           "\"^Version [[:digit:]]*\.[[:digit:]]*\.[[:digit:]]*\" "
            "svn/trunk"), "push_hash\n"),
       Git("svn find-rev push_hash", "123455\n"),
       Git("log -1 --format=%s push_hash",
@@ -944,7 +944,7 @@ deps = {

     self.ExpectGit([
       Git(("log -1 --format=%H --grep="
-           "\"^Version [[:digit:]]*\.[[:digit:]]*\.[[:digit:]]* (based\" "
+           "\"^Version [[:digit:]]*\.[[:digit:]]*\.[[:digit:]]*\" "
            "svn/trunk"), "push_hash\n"),
       Git("svn find-rev push_hash", "123455\n"),
     ])
@@ -964,7 +964,7 @@ deps = {

     self.ExpectGit([
       Git(("log -1 --format=%H --grep="
-           "\"^Version [[:digit:]]*\.[[:digit:]]*\.[[:digit:]]* (based\" "
+           "\"^Version [[:digit:]]*\.[[:digit:]]*\.[[:digit:]]*\" "
            "svn/trunk"), "push_hash\n"),
       Git("svn find-rev push_hash", "123456\n"),
     ])


--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to