Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(190)

Side by Side Diff: tools/push-to-trunk/auto_roll.py

Issue 81193002: Pythonification and refactoring of push-to-trunk. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Refactor step generation. Created 7 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | tools/push-to-trunk/common_includes.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/env python 1 #!/usr/bin/env python
2 # Copyright 2013 the V8 project authors. All rights reserved. 2 # Copyright 2013 the V8 project authors. All rights reserved.
3 # Redistribution and use in source and binary forms, with or without 3 # Redistribution and use in source and binary forms, with or without
4 # modification, are permitted provided that the following conditions are 4 # modification, are permitted provided that the following conditions are
5 # met: 5 # met:
6 # 6 #
7 # * Redistributions of source code must retain the above copyright 7 # * Redistributions of source code must retain the above copyright
8 # notice, this list of conditions and the following disclaimer. 8 # notice, this list of conditions and the following disclaimer.
9 # * Redistributions in binary form must reproduce the above 9 # * Redistributions in binary form must reproduce the above
10 # copyright notice, this list of conditions and the following 10 # copyright notice, this list of conditions and the following
(...skipping 21 matching lines...) Expand all
32 32
33 from common_includes import * 33 from common_includes import *
34 34
35 CONFIG = { 35 CONFIG = {
36 PERSISTFILE_BASENAME: "/tmp/v8-auto-roll-tempfile", 36 PERSISTFILE_BASENAME: "/tmp/v8-auto-roll-tempfile",
37 DOT_GIT_LOCATION: ".git", 37 DOT_GIT_LOCATION: ".git",
38 } 38 }
39 39
40 40
41 class Preparation(Step): 41 class Preparation(Step):
42 def __init__(self): 42 MESSAGE = "Preparation."
43 Step.__init__(self, "Preparation.")
44 43
45 def RunStep(self): 44 def RunStep(self):
46 self.InitialEnvironmentChecks() 45 self.InitialEnvironmentChecks()
47 self.CommonPrepare() 46 self.CommonPrepare()
48 47
49 48
50 class FetchLatestRevision(Step): 49 class FetchLatestRevision(Step):
51 def __init__(self): 50 MESSAGE = "Fetching latest V8 revision."
52 Step.__init__(self, "Fetching latest V8 revision.")
53 51
54 def RunStep(self): 52 def RunStep(self):
55 log = self.Git("svn log -1 --oneline").strip() 53 log = self.Git("svn log -1 --oneline").strip()
56 match = re.match(r"^r(\d+) ", log) 54 match = re.match(r"^r(\d+) ", log)
57 if not match: 55 if not match:
58 self.Die("Could not extract current svn revision from log.") 56 self.Die("Could not extract current svn revision from log.")
59 self.Persist("latest", match.group(1)) 57 self.Persist("latest", match.group(1))
60 58
61 59
62 class FetchLKGR(Step): 60 class FetchLKGR(Step):
63 def __init__(self): 61 MESSAGE = "Fetching V8 LKGR."
64 Step.__init__(self, "Fetching V8 LKGR.")
65 62
66 def RunStep(self): 63 def RunStep(self):
67 lkgr_url = "https://v8-status.appspot.com/lkgr" 64 lkgr_url = "https://v8-status.appspot.com/lkgr"
68 self.Persist("lkgr", self.ReadURL(lkgr_url)) 65 self.Persist("lkgr", self.ReadURL(lkgr_url))
69 66
70 67
71 class PushToTrunk(Step): 68 class PushToTrunk(Step):
72 def __init__(self): 69 MESSAGE = "Pushing to trunk if possible."
73 Step.__init__(self, "Pushing to trunk if possible.")
74 70
75 def RunStep(self): 71 def RunStep(self):
76 self.RestoreIfUnset("latest") 72 self.RestoreIfUnset("latest")
77 self.RestoreIfUnset("lkgr") 73 self.RestoreIfUnset("lkgr")
78 latest = int(self._state["latest"]) 74 latest = int(self._state["latest"])
79 lkgr = int(self._state["lkgr"]) 75 lkgr = int(self._state["lkgr"])
80 if latest == lkgr: 76 if latest == lkgr:
81 print "ToT (r%d) is clean. Pushing to trunk." % latest 77 print "ToT (r%d) is clean. Pushing to trunk." % latest
82 # TODO(machenbach): Call push to trunk script. 78 # TODO(machenbach): Call push to trunk script.
83 else: 79 else:
(...skipping 21 matching lines...) Expand all
105 return result 101 return result
106 102
107 103
108 def Main(): 104 def Main():
109 parser = BuildOptions() 105 parser = BuildOptions()
110 (options, args) = parser.parse_args() 106 (options, args) = parser.parse_args()
111 RunAutoRoll(CONFIG, options) 107 RunAutoRoll(CONFIG, options)
112 108
113 if __name__ == "__main__": 109 if __name__ == "__main__":
114 sys.exit(Main()) 110 sys.exit(Main())
OLDNEW
« no previous file with comments | « no previous file | tools/push-to-trunk/common_includes.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698