Upstream version 10.39.225.0
[platform/framework/web/crosswalk.git] / src / v8 / tools / push-to-trunk / auto_push.py
index aeaea80..fef3b53 100755 (executable)
@@ -36,22 +36,13 @@ import urllib
 from common_includes import *
 import push_to_trunk
 
-SETTINGS_LOCATION = "SETTINGS_LOCATION"
-
-CONFIG = {
-  PERSISTFILE_BASENAME: "/tmp/v8-auto-push-tempfile",
-  DOT_GIT_LOCATION: ".git",
-  SETTINGS_LOCATION: "~/.auto-roll",
-}
-
 PUSH_MESSAGE_RE = re.compile(r".* \(based on bleeding_edge revision r(\d+)\)$")
 
-
 class Preparation(Step):
   MESSAGE = "Preparation."
 
   def RunStep(self):
-    self.InitialEnvironmentChecks()
+    self.InitialEnvironmentChecks(self.default_cwd)
     self.CommonPrepare()
 
 
@@ -59,7 +50,7 @@ class CheckAutoPushSettings(Step):
   MESSAGE = "Checking settings file."
 
   def RunStep(self):
-    settings_file = os.path.realpath(self.Config(SETTINGS_LOCATION))
+    settings_file = os.path.realpath(self.Config("SETTINGS_LOCATION"))
     if os.path.exists(settings_file):
       settings_dict = json.loads(FileToText(settings_file))
       if settings_dict.get("enable_auto_roll") is False:
@@ -119,9 +110,8 @@ class PushToTrunk(Step):
 
     # TODO(machenbach): Update the script before calling it.
     if self._options.push:
-      P = push_to_trunk.PushToTrunk
       self._side_effect_handler.Call(
-          P(push_to_trunk.CONFIG, self._side_effect_handler).Run,
+          push_to_trunk.PushToTrunk().Run,
           ["--author", self._options.author,
            "--reviewer", self._options.reviewer,
            "--revision", self["lkgr"],
@@ -141,6 +131,12 @@ class AutoPush(ScriptsBase):
     options.requires_editor = False
     return True
 
+  def _Config(self):
+    return {
+      "PERSISTFILE_BASENAME": "/tmp/v8-auto-push-tempfile",
+      "SETTINGS_LOCATION": "~/.auto-roll",
+    }
+
   def _Steps(self):
     return [
       Preparation,
@@ -153,4 +149,4 @@ class AutoPush(ScriptsBase):
 
 
 if __name__ == "__main__":  # pragma: no cover
-  sys.exit(AutoPush(CONFIG).Run())
+  sys.exit(AutoPush().Run())