OLD | NEW |
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 Loading... |
32 import urllib2 | 32 import urllib2 |
33 | 33 |
34 from common_includes import * | 34 from common_includes import * |
35 | 35 |
36 TRUNKBRANCH = "TRUNKBRANCH" | 36 TRUNKBRANCH = "TRUNKBRANCH" |
37 | 37 |
38 CONFIG = { | 38 CONFIG = { |
39 BRANCHNAME: "prepare-push", | 39 BRANCHNAME: "prepare-push", |
40 TRUNKBRANCH: "trunk-push", | 40 TRUNKBRANCH: "trunk-push", |
41 PERSISTFILE_BASENAME: "/tmp/v8-push-to-trunk-tempfile", | 41 PERSISTFILE_BASENAME: "/tmp/v8-push-to-trunk-tempfile", |
42 TEMP_BRANCH: "prepare-push-temporary-branch-created-by-script", | |
43 DOT_GIT_LOCATION: ".git", | 42 DOT_GIT_LOCATION: ".git", |
44 VERSION_FILE: "src/version.cc", | 43 VERSION_FILE: "src/version.cc", |
45 CHANGELOG_FILE: "ChangeLog", | 44 CHANGELOG_FILE: "ChangeLog", |
46 CHANGELOG_ENTRY_FILE: "/tmp/v8-push-to-trunk-tempfile-changelog-entry", | 45 CHANGELOG_ENTRY_FILE: "/tmp/v8-push-to-trunk-tempfile-changelog-entry", |
47 PATCH_FILE: "/tmp/v8-push-to-trunk-tempfile-patch-file", | 46 PATCH_FILE: "/tmp/v8-push-to-trunk-tempfile-patch-file", |
48 COMMITMSG_FILE: "/tmp/v8-push-to-trunk-tempfile-commitmsg", | 47 COMMITMSG_FILE: "/tmp/v8-push-to-trunk-tempfile-commitmsg", |
49 } | 48 } |
50 | 49 |
51 PUSH_MESSAGE_SUFFIX = " (based on bleeding_edge revision r%d)" | 50 PUSH_MESSAGE_SUFFIX = " (based on bleeding_edge revision r%d)" |
52 PUSH_MESSAGE_RE = re.compile(r".* \(based on bleeding_edge revision r(\d+)\)$") | 51 PUSH_MESSAGE_RE = re.compile(r".* \(based on bleeding_edge revision r(\d+)\)$") |
53 | 52 |
54 | 53 |
55 class Preparation(Step): | 54 class Preparation(Step): |
56 MESSAGE = "Preparation." | 55 MESSAGE = "Preparation." |
57 | 56 |
58 def RunStep(self): | 57 def RunStep(self): |
59 self.InitialEnvironmentChecks() | 58 self.InitialEnvironmentChecks() |
60 self.CommonPrepare() | 59 self.CommonPrepare() |
| 60 |
| 61 if(self["current_branch"] == self.Config(TRUNKBRANCH) |
| 62 or self["current_branch"] == self.Config(BRANCHNAME)): |
| 63 print "Warning: Script started on branch %s" % self["current_branch"] |
| 64 |
61 self.PrepareBranch() | 65 self.PrepareBranch() |
62 self.DeleteBranch(self.Config(TRUNKBRANCH)) | 66 self.DeleteBranch(self.Config(TRUNKBRANCH)) |
63 | 67 |
64 | 68 |
65 class FreshBranch(Step): | 69 class FreshBranch(Step): |
66 MESSAGE = "Create a fresh branch." | 70 MESSAGE = "Create a fresh branch." |
67 | 71 |
68 def RunStep(self): | 72 def RunStep(self): |
69 self.GitCreateBranch(self.Config(BRANCHNAME), "svn/bleeding_edge") | 73 self.GitCreateBranch(self.Config(BRANCHNAME), "svn/bleeding_edge") |
70 | 74 |
(...skipping 365 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
436 CommitTrunk, | 440 CommitTrunk, |
437 SanityCheck, | 441 SanityCheck, |
438 CommitSVN, | 442 CommitSVN, |
439 TagRevision, | 443 TagRevision, |
440 CleanUp, | 444 CleanUp, |
441 ] | 445 ] |
442 | 446 |
443 | 447 |
444 if __name__ == "__main__": # pragma: no cover | 448 if __name__ == "__main__": # pragma: no cover |
445 sys.exit(PushToTrunk(CONFIG).Run()) | 449 sys.exit(PushToTrunk(CONFIG).Run()) |
OLD | NEW |