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

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

Issue 591783003: Refactoring: Remove more legacy from release scripts. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Read version file relative to cwd. 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 | « no previous file | tools/push-to-trunk/bump_up_version.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 sys 7 import sys
8 8
9 from common_includes import * 9 from common_includes import *
10 10
tandrii(chromium) 2014/09/23 14:39:54 I guess this is historical, but * imports make it
11 CONFIG = { 11 CONFIG = {
12 BRANCHNAME: "auto-tag-v8", 12 BRANCHNAME: "auto-tag-v8",
13 PERSISTFILE_BASENAME: "/tmp/v8-auto-tag-tempfile", 13 PERSISTFILE_BASENAME: "/tmp/v8-auto-tag-tempfile",
14 VERSION_FILE: "src/version.cc",
15 } 14 }
16 15
17 16
18 class Preparation(Step): 17 class Preparation(Step):
19 MESSAGE = "Preparation." 18 MESSAGE = "Preparation."
20 19
21 def RunStep(self): 20 def RunStep(self):
22 self.CommonPrepare() 21 self.CommonPrepare()
23 self.PrepareBranch() 22 self.PrepareBranch()
24 self.GitCheckout("master") 23 self.GitCheckout("master")
(...skipping 22 matching lines...) Expand all
47 self["candidate"] = None 46 self["candidate"] = None
48 self["candidate_version"] = None 47 self["candidate_version"] = None
49 self["next"] = None 48 self["next"] = None
50 self["next_version"] = None 49 self["next_version"] = None
51 50
52 # Iterate backwards through all automatic version updates. 51 # Iterate backwards through all automatic version updates.
53 for git_hash in self.GitLog( 52 for git_hash in self.GitLog(
54 format="%H", grep="\\[Auto\\-roll\\] Bump up version to").splitlines(): 53 format="%H", grep="\\[Auto\\-roll\\] Bump up version to").splitlines():
55 54
56 # Get the version. 55 # Get the version.
57 if not self.GitCheckoutFileSafe(self._config[VERSION_FILE], git_hash): 56 if not self.GitCheckoutFileSafe(VERSION_FILE, git_hash):
58 continue 57 continue
59 58
60 self.ReadAndPersistVersion() 59 self.ReadAndPersistVersion()
61 version = self.ArrayToVersion("") 60 version = self.ArrayToVersion("")
62 61
63 # Strip off trailing patch level (tags don't include tag level 0). 62 # Strip off trailing patch level (tags don't include tag level 0).
64 if version.endswith(".0"): 63 if version.endswith(".0"):
65 version = version[:-2] 64 version = version[:-2]
66 65
67 # Clean up checked-out version file. 66 # Clean up checked-out version file.
68 self.GitCheckoutFileSafe(self._config[VERSION_FILE], "HEAD") 67 self.GitCheckoutFileSafe(VERSION_FILE, "HEAD")
69 68
70 if version in tags: 69 if version in tags:
71 if self["candidate"]: 70 if self["candidate"]:
72 # Revision "git_hash" is tagged already and "candidate" was the next 71 # Revision "git_hash" is tagged already and "candidate" was the next
73 # newer revision without a tag. 72 # newer revision without a tag.
74 break 73 break
75 else: 74 else:
76 print("Stop as %s is the latest version and it has been tagged." % 75 print("Stop as %s is the latest version and it has been tagged." %
77 version) 76 version)
78 self.CommonCleanup() 77 self.CommonCleanup()
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
190 GetOldestUntaggedVersion, 189 GetOldestUntaggedVersion,
191 GetLKGRs, 190 GetLKGRs,
192 CalculateTagRevision, 191 CalculateTagRevision,
193 MakeTag, 192 MakeTag,
194 CleanUp, 193 CleanUp,
195 ] 194 ]
196 195
197 196
198 if __name__ == "__main__": # pragma: no cover 197 if __name__ == "__main__": # pragma: no cover
199 sys.exit(AutoTag(CONFIG).Run()) 198 sys.exit(AutoTag(CONFIG).Run())
OLDNEW
« no previous file with comments | « no previous file | tools/push-to-trunk/bump_up_version.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698