| OLD | NEW |
| 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 # 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 23 matching lines...) Expand all Loading... |
| 34 | 34 |
| 35 ALREADY_MERGING_SENTINEL_FILE = "ALREADY_MERGING_SENTINEL_FILE" | 35 ALREADY_MERGING_SENTINEL_FILE = "ALREADY_MERGING_SENTINEL_FILE" |
| 36 COMMIT_HASHES_FILE = "COMMIT_HASHES_FILE" | 36 COMMIT_HASHES_FILE = "COMMIT_HASHES_FILE" |
| 37 TEMPORARY_PATCH_FILE = "TEMPORARY_PATCH_FILE" | 37 TEMPORARY_PATCH_FILE = "TEMPORARY_PATCH_FILE" |
| 38 | 38 |
| 39 CONFIG = { | 39 CONFIG = { |
| 40 BRANCHNAME: "prepare-merge", | 40 BRANCHNAME: "prepare-merge", |
| 41 PERSISTFILE_BASENAME: "/tmp/v8-merge-to-branch-tempfile", | 41 PERSISTFILE_BASENAME: "/tmp/v8-merge-to-branch-tempfile", |
| 42 ALREADY_MERGING_SENTINEL_FILE: | 42 ALREADY_MERGING_SENTINEL_FILE: |
| 43 "/tmp/v8-merge-to-branch-tempfile-already-merging", | 43 "/tmp/v8-merge-to-branch-tempfile-already-merging", |
| 44 DOT_GIT_LOCATION: ".git", | |
| 45 VERSION_FILE: "src/version.cc", | 44 VERSION_FILE: "src/version.cc", |
| 46 TEMPORARY_PATCH_FILE: "/tmp/v8-prepare-merge-tempfile-temporary-patch", | 45 TEMPORARY_PATCH_FILE: "/tmp/v8-prepare-merge-tempfile-temporary-patch", |
| 47 COMMITMSG_FILE: "/tmp/v8-prepare-merge-tempfile-commitmsg", | 46 COMMITMSG_FILE: "/tmp/v8-prepare-merge-tempfile-commitmsg", |
| 48 COMMIT_HASHES_FILE: "/tmp/v8-merge-to-branch-tempfile-PATCH_COMMIT_HASHES", | 47 COMMIT_HASHES_FILE: "/tmp/v8-merge-to-branch-tempfile-PATCH_COMMIT_HASHES", |
| 49 } | 48 } |
| 50 | 49 |
| 51 | 50 |
| 52 class Preparation(Step): | 51 class Preparation(Step): |
| 53 MESSAGE = "Preparation." | 52 MESSAGE = "Preparation." |
| 54 | 53 |
| 55 def RunStep(self): | 54 def RunStep(self): |
| 56 if os.path.exists(self.Config(ALREADY_MERGING_SENTINEL_FILE)): | 55 if os.path.exists(self.Config(ALREADY_MERGING_SENTINEL_FILE)): |
| 57 if self._options.force: | 56 if self._options.force: |
| 58 os.remove(self.Config(ALREADY_MERGING_SENTINEL_FILE)) | 57 os.remove(self.Config(ALREADY_MERGING_SENTINEL_FILE)) |
| 59 elif self._options.step == 0: # pragma: no cover | 58 elif self._options.step == 0: # pragma: no cover |
| 60 self.Die("A merge is already in progress") | 59 self.Die("A merge is already in progress") |
| 61 open(self.Config(ALREADY_MERGING_SENTINEL_FILE), "a").close() | 60 open(self.Config(ALREADY_MERGING_SENTINEL_FILE), "a").close() |
| 62 | 61 |
| 63 self.InitialEnvironmentChecks() | 62 self.InitialEnvironmentChecks(self.default_cwd) |
| 64 if self._options.revert_bleeding_edge: | 63 if self._options.revert_bleeding_edge: |
| 65 self["merge_to_branch"] = "bleeding_edge" | 64 self["merge_to_branch"] = "bleeding_edge" |
| 66 elif self._options.branch: | 65 elif self._options.branch: |
| 67 self["merge_to_branch"] = self._options.branch | 66 self["merge_to_branch"] = self._options.branch |
| 68 else: # pragma: no cover | 67 else: # pragma: no cover |
| 69 self.Die("Please specify a branch to merge to") | 68 self.Die("Please specify a branch to merge to") |
| 70 | 69 |
| 71 self.CommonPrepare() | 70 self.CommonPrepare() |
| 72 self.PrepareBranch() | 71 self.PrepareBranch() |
| 73 | 72 |
| (...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 325 UploadStep, | 324 UploadStep, |
| 326 CommitRepository, | 325 CommitRepository, |
| 327 PrepareSVN, | 326 PrepareSVN, |
| 328 TagRevision, | 327 TagRevision, |
| 329 CleanUp, | 328 CleanUp, |
| 330 ] | 329 ] |
| 331 | 330 |
| 332 | 331 |
| 333 if __name__ == "__main__": # pragma: no cover | 332 if __name__ == "__main__": # pragma: no cover |
| 334 sys.exit(MergeToBranch(CONFIG).Run()) | 333 sys.exit(MergeToBranch(CONFIG).Run()) |
| OLD | NEW |