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

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

Issue 540973002: Add cwd to all shell commands in auto roll scripts. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: 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/git_recipes.py ('k') | tools/push-to-trunk/releases.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
11 # disclaimer in the documentation and/or other materials provided 11 # disclaimer in the documentation and/or other materials provided
12 # with the distribution. 12 # with the distribution.
13 # * Neither the name of Google Inc. nor the names of its 13 # * Neither the name of Google Inc. nor the names of its
14 # contributors may be used to endorse or promote products derived 14 # contributors may be used to endorse or promote products derived
15 # from this software without specific prior written permission. 15 # from this software without specific prior written permission.
16 # 16 #
17 # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 17 # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
18 # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 18 # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
19 # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 19 # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
20 # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 20 # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
21 # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 21 # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
22 # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 22 # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
23 # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 23 # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
24 # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 24 # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
25 # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25 # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 26 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
27 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 28
29 import argparse 29 import argparse
30 import os
30 import sys 31 import sys
31 import tempfile 32 import tempfile
32 import urllib2 33 import urllib2
33 34
34 from common_includes import * 35 from common_includes import *
35 36
36 TRUNKBRANCH = "TRUNKBRANCH" 37 TRUNKBRANCH = "TRUNKBRANCH"
37 38
38 CONFIG = { 39 CONFIG = {
39 BRANCHNAME: "prepare-push", 40 BRANCHNAME: "prepare-push",
(...skipping 265 matching lines...) Expand 10 before | Expand all | Expand 10 after
305 306
306 def RunStep(self): 307 def RunStep(self):
307 self.GitCreateBranch(self.Config(TRUNKBRANCH), "svn/trunk") 308 self.GitCreateBranch(self.Config(TRUNKBRANCH), "svn/trunk")
308 309
309 310
310 class ApplyChanges(Step): 311 class ApplyChanges(Step):
311 MESSAGE = "Apply squashed changes." 312 MESSAGE = "Apply squashed changes."
312 313
313 def RunStep(self): 314 def RunStep(self):
314 self.ApplyPatch(self.Config(PATCH_FILE)) 315 self.ApplyPatch(self.Config(PATCH_FILE))
315 Command("rm", "-f %s*" % self.Config(PATCH_FILE)) 316 os.remove(self.Config(PATCH_FILE))
316 317
317 318
318 class AddChangeLog(Step): 319 class AddChangeLog(Step):
319 MESSAGE = "Add ChangeLog changes to trunk branch." 320 MESSAGE = "Add ChangeLog changes to trunk branch."
320 321
321 def RunStep(self): 322 def RunStep(self):
322 # The change log has been modified by the patch. Reset it to the version 323 # The change log has been modified by the patch. Reset it to the version
323 # on trunk and apply the exact changes determined by this PrepareChangeLog 324 # on trunk and apply the exact changes determined by this PrepareChangeLog
324 # step above. 325 # step above.
325 self.GitCheckoutFile(self.Config(CHANGELOG_FILE), "svn/trunk") 326 self.GitCheckoutFile(self.Config(CHANGELOG_FILE), "svn/trunk")
(...skipping 12 matching lines...) Expand all
338 # on trunk and apply the correct version. 339 # on trunk and apply the correct version.
339 self.GitCheckoutFile(self.Config(VERSION_FILE), "svn/trunk") 340 self.GitCheckoutFile(self.Config(VERSION_FILE), "svn/trunk")
340 self.SetVersion(self.Config(VERSION_FILE), "new_") 341 self.SetVersion(self.Config(VERSION_FILE), "new_")
341 342
342 343
343 class CommitTrunk(Step): 344 class CommitTrunk(Step):
344 MESSAGE = "Commit to local trunk branch." 345 MESSAGE = "Commit to local trunk branch."
345 346
346 def RunStep(self): 347 def RunStep(self):
347 self.GitCommit(file_name = self.Config(COMMITMSG_FILE)) 348 self.GitCommit(file_name = self.Config(COMMITMSG_FILE))
348 Command("rm", "-f %s*" % self.Config(COMMITMSG_FILE)) 349 os.remove(self.Config(COMMITMSG_FILE))
349 350
350 351
351 class SanityCheck(Step): 352 class SanityCheck(Step):
352 MESSAGE = "Sanity check." 353 MESSAGE = "Sanity check."
353 354
354 def RunStep(self): 355 def RunStep(self):
355 # TODO(machenbach): Run presubmit script here as it is now missing in the 356 # TODO(machenbach): Run presubmit script here as it is now missing in the
356 # prepare push process. 357 # prepare push process.
357 if not self.Confirm("Please check if your local checkout is sane: Inspect " 358 if not self.Confirm("Please check if your local checkout is sane: Inspect "
358 "%s, compile, run tests. Do you want to commit this new trunk " 359 "%s, compile, run tests. Do you want to commit this new trunk "
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
458 CommitTrunk, 459 CommitTrunk,
459 SanityCheck, 460 SanityCheck,
460 CommitSVN, 461 CommitSVN,
461 TagRevision, 462 TagRevision,
462 CleanUp, 463 CleanUp,
463 ] 464 ]
464 465
465 466
466 if __name__ == "__main__": # pragma: no cover 467 if __name__ == "__main__": # pragma: no cover
467 sys.exit(PushToTrunk(CONFIG).Run()) 468 sys.exit(PushToTrunk(CONFIG).Run())
OLDNEW
« no previous file with comments | « tools/push-to-trunk/git_recipes.py ('k') | tools/push-to-trunk/releases.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698