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

Unified Diff: tools/release/create_release.py

Issue 1887583002: [release] Let release script fix missing tags. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | tools/release/test_scripts.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/release/create_release.py
diff --git a/tools/release/create_release.py b/tools/release/create_release.py
index 7477ea1461f5ebc8b10de654fd7136033a8292b4..6ed45a326be170f940998809a07f35f58769accb 100755
--- a/tools/release/create_release.py
+++ b/tools/release/create_release.py
@@ -223,6 +223,27 @@ class CommitBranch(Step):
os.remove(self.Config("CHANGELOG_ENTRY_FILE"))
+class FixBrokenTag(Step):
+ MESSAGE = "Check for a missing tag and fix that instead."
+
+ def RunStep(self):
+ commit = None
+ try:
+ commit = self.GitLog(
+ n=1, format="%H",
+ grep=self["commit_title"],
+ branch="origin/%s" % self["version"],
+ )
+ except GitFailedException:
+ # In the normal case, the remote doesn't exist yet and git will fail.
+ pass
+ if commit:
+ print "Found %s. Trying to repair tag and bail out." % self["version"]
+ self.step.Git("tag %s %s" % (self["version"], commit))
+ self.step.Git("push origin %s" % self["version"])
+ return True
+
+
class PushBranch(Step):
MESSAGE = "Push changes."
@@ -303,6 +324,7 @@ class CreateRelease(ScriptsBase):
SetVersion,
EnableMergeWatchlist,
CommitBranch,
+ FixBrokenTag,
PushBranch,
TagRevision,
CleanUp,
« no previous file with comments | « no previous file | tools/release/test_scripts.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698