Reviewers: jarin,

Message:
Committed patchset #1 (id:1) manually as 23633 (presubmit successful).

Description:
Add dry-run feature to auto roll scripts.

BUG=408523
LOG=n
[email protected]

Committed: https://code.google.com/p/v8/source/detail?r=23633

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

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

Affected files (+14, -6 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


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 4267ac23ffaf997c4fe3b761a528c6737d8c221d..65fad92ab6f0bf2973dcde35681510721f1b9ac7 100755
--- a/tools/push-to-trunk/auto_roll.py
+++ b/tools/push-to-trunk/auto_roll.py
@@ -100,6 +100,8 @@ class RollChromium(Step):
       if self._options.sheriff:
         args.extend([
"--sheriff", "--googlers-mapping", self._options.googlers_mapping])
+      if self._options.dry_run:
+        args.extend(["--dry-run"])
       R = chromium_roll.ChromiumRoll
       self._side_effect_handler.Call(
           R(chromium_roll.CONFIG, self._side_effect_handler).Run,
@@ -111,8 +113,7 @@ class AutoRoll(ScriptsBase):
     parser.add_argument("-c", "--chromium", required=True,
                         help=("The path to your Chromium src/ "
                               "directory to automate the V8 roll."))
-    parser.add_argument("--roll",
-                        help="Make Chromium roll. Dry run if unspecified.",
+    parser.add_argument("--roll", help="Call Chromium roll script.",
                         default=False, action="store_true")

   def _ProcessOptions(self, options):  # pragma: no cover
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 4e0137057170b839483d64d2751b82af48d54635..03f18f6e605ac58c7f0441699da85093a6e93037 100755
--- a/tools/push-to-trunk/chromium_roll.py
+++ b/tools/push-to-trunk/chromium_roll.py
@@ -87,10 +87,15 @@ class UploadCL(Step):
                  % self["sheriff"])
     self.GitCommit("%s%s\n\nTBR=%s" %
                    (commit_title, sheriff, self._options.reviewer))
-    self.GitUpload(author=self._options.author,
-                   force=True,
-                   cq=self._options.use_commit_queue)
-    print "CL uploaded."
+    if not self._options.dry_run:
+      self.GitUpload(author=self._options.author,
+                     force=True,
+                     cq=self._options.use_commit_queue)
+      print "CL uploaded."
+    else:
+      self.GitCheckout("master")
+      self.GitDeleteBranch("v8-roll-%s" % self["trunk_revision"])
+      print "Dry run - don't upload."


 class SwitchV8(Step):
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 0e57a25bb14c84318b553174f6e71feb8f181004..7770ce0762cffae84833a2499401d99724d29239 100644
--- a/tools/push-to-trunk/common_includes.py
+++ b/tools/push-to-trunk/common_includes.py
@@ -592,6 +592,8 @@ class ScriptsBase(object):
     parser = argparse.ArgumentParser(description=self._Description())
     parser.add_argument("-a", "--author", default="",
                         help="The author email used for rietveld.")
+    parser.add_argument("--dry-run", default=False, action="store_true",
+                        help="Perform only read-only actions.")
     parser.add_argument("-g", "--googlers-mapping",
                         help="Path to the script mapping google accounts.")
     parser.add_argument("-r", "--reviewer", default="",


--
--
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