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

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

Issue 585893002: Refactoring: Use fake cwd in release script tests. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Remove git location legacy. Created 6 years, 3 months 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 | « tools/push-to-trunk/auto_tag.py ('k') | 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 2014 the V8 project authors. All rights reserved. 2 # Copyright 2014 the V8 project authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be 3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file. 4 # found in the LICENSE file.
5 5
6 import argparse 6 import argparse
7 import os 7 import os
8 import sys 8 import sys
9 9
10 from common_includes import * 10 from common_includes import *
11 11
12 CHROMIUM = "CHROMIUM" 12 CHROMIUM = "CHROMIUM"
13 13
14 CONFIG = { 14 CONFIG = {
15 PERSISTFILE_BASENAME: "/tmp/v8-chromium-roll-tempfile", 15 PERSISTFILE_BASENAME: "/tmp/v8-chromium-roll-tempfile",
16 DOT_GIT_LOCATION: ".git",
17 } 16 }
18 17
19 18
20 class Preparation(Step): 19 class Preparation(Step):
21 MESSAGE = "Preparation." 20 MESSAGE = "Preparation."
22 21
23 def RunStep(self): 22 def RunStep(self):
24 # Update v8 remote tracking branches. 23 # Update v8 remote tracking branches.
25 self.GitFetchOrigin() 24 self.GitFetchOrigin()
26 25
27 26
28 class DetectLastPush(Step): 27 class DetectLastPush(Step):
29 MESSAGE = "Detect commit ID of last push to trunk." 28 MESSAGE = "Detect commit ID of last push to trunk."
30 29
31 def RunStep(self): 30 def RunStep(self):
32 self["last_push"] = self._options.last_push or self.FindLastTrunkPush( 31 self["last_push"] = self._options.last_push or self.FindLastTrunkPush(
33 branch="origin/master", include_patches=True) 32 branch="origin/master", include_patches=True)
34 self["trunk_revision"] = self.GetCommitPositionNumber(self["last_push"]) 33 self["trunk_revision"] = self.GetCommitPositionNumber(self["last_push"])
35 self["push_title"] = self.GitLog(n=1, format="%s", 34 self["push_title"] = self.GitLog(n=1, format="%s",
36 git_hash=self["last_push"]) 35 git_hash=self["last_push"])
37 36
38 37
39 class SwitchChromium(Step): 38 class SwitchChromium(Step):
40 MESSAGE = "Switch to Chromium checkout." 39 MESSAGE = "Switch to Chromium checkout."
41 40
42 def RunStep(self): 41 def RunStep(self):
43 self["v8_path"] = os.getcwd() 42 self["v8_path"] = os.getcwd()
44 cwd = self._options.chromium 43 cwd = self._options.chromium
45 os.chdir(cwd) 44 os.chdir(cwd)
46 self.InitialEnvironmentChecks() 45 self.InitialEnvironmentChecks(cwd)
47 # Check for a clean workdir. 46 # Check for a clean workdir.
48 if not self.GitIsWorkdirClean(cwd=cwd): # pragma: no cover 47 if not self.GitIsWorkdirClean(cwd=cwd): # pragma: no cover
49 self.Die("Workspace is not clean. Please commit or undo your changes.") 48 self.Die("Workspace is not clean. Please commit or undo your changes.")
50 # Assert that the DEPS file is there. 49 # Assert that the DEPS file is there.
51 if not os.path.exists(os.path.join(cwd, "DEPS")): # pragma: no cover 50 if not os.path.exists(os.path.join(cwd, "DEPS")): # pragma: no cover
52 self.Die("DEPS file not present.") 51 self.Die("DEPS file not present.")
53 52
54 53
55 class UpdateChromiumCheckout(Step): 54 class UpdateChromiumCheckout(Step):
56 MESSAGE = "Update the checkout and create a new branch." 55 MESSAGE = "Update the checkout and create a new branch."
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
149 SwitchChromium, 148 SwitchChromium,
150 UpdateChromiumCheckout, 149 UpdateChromiumCheckout,
151 UploadCL, 150 UploadCL,
152 SwitchV8, 151 SwitchV8,
153 CleanUp, 152 CleanUp,
154 ] 153 ]
155 154
156 155
157 if __name__ == "__main__": # pragma: no cover 156 if __name__ == "__main__": # pragma: no cover
158 sys.exit(ChromiumRoll(CONFIG).Run()) 157 sys.exit(ChromiumRoll(CONFIG).Run())
OLDNEW
« no previous file with comments | « tools/push-to-trunk/auto_tag.py ('k') | tools/push-to-trunk/common_includes.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698