Commit 53d0e1cb authored by Michael Achenbach's avatar Michael Achenbach Committed by Commit Bot

[release] Fix create-release script for Gerrit

This uploads roll-branch CLs before landing and fixes an
ambiguity bug when pushing tags.

NOTRY=true
TBR=hablich@chromium.org

Bug: chromium:738679
Change-Id: I51e03d714ec97ee2d9bca4ecaf753d66038891c1
Reviewed-on: https://chromium-review.googlesource.com/558415Reviewed-by: 's avatarMichael Achenbach <machenbach@chromium.org>
Commit-Queue: Michael Achenbach <machenbach@chromium.org>
Cr-Commit-Position: refs/heads/master@{#46382}
parent cc59f8b1
...@@ -395,7 +395,7 @@ class GitInterface(VCInterface): ...@@ -395,7 +395,7 @@ class GitInterface(VCInterface):
"git updater is lagging behind?") "git updater is lagging behind?")
self.step.Git("tag %s %s" % (tag, commit)) self.step.Git("tag %s %s" % (tag, commit))
self.step.Git("push origin %s" % tag) self.step.Git("push origin refs/tags/%s:refs/tags/%s" % (tag, tag))
def CLLand(self): def CLLand(self):
self.step.GitCLLand() self.step.GitCLLand()
......
...@@ -221,6 +221,7 @@ class CommitBranch(Step): ...@@ -221,6 +221,7 @@ class CommitBranch(Step):
if not text: # pragma: no cover if not text: # pragma: no cover
self.Die("Commit message editing failed.") self.Die("Commit message editing failed.")
text += "\n\nTBR=%s" % self._options.reviewer
self["commit_title"] = text.splitlines()[0] self["commit_title"] = text.splitlines()[0]
TextToFile(text, self.Config("COMMITMSG_FILE")) TextToFile(text, self.Config("COMMITMSG_FILE"))
...@@ -229,10 +230,16 @@ class CommitBranch(Step): ...@@ -229,10 +230,16 @@ class CommitBranch(Step):
os.remove(self.Config("CHANGELOG_ENTRY_FILE")) os.remove(self.Config("CHANGELOG_ENTRY_FILE"))
class PushBranch(Step): class LandBranch(Step):
MESSAGE = "Push changes." MESSAGE = "Upload and land changes."
def RunStep(self): def RunStep(self):
if self._options.dry_run:
print "Dry run - upload CL."
else:
self.GitUpload(author=self._options.author,
force=True,
bypass_hooks=True)
cmd = "cl land --bypass-hooks -f" cmd = "cl land --bypass-hooks -f"
if self._options.dry_run: if self._options.dry_run:
print "Dry run. Command:\ngit %s" % cmd print "Dry run. Command:\ngit %s" % cmd
...@@ -305,7 +312,7 @@ class CreateRelease(ScriptsBase): ...@@ -305,7 +312,7 @@ class CreateRelease(ScriptsBase):
SetVersion, SetVersion,
EnableMergeWatchlist, EnableMergeWatchlist,
CommitBranch, CommitBranch,
PushBranch, LandBranch,
TagRevision, TagRevision,
CleanUp, CleanUp,
] ]
......
...@@ -861,7 +861,7 @@ Performance and stability improvements on all platforms.""" ...@@ -861,7 +861,7 @@ Performance and stability improvements on all platforms."""
"\"Version 3.22.5 (based on push_hash)\"" "\"Version 3.22.5 (based on push_hash)\""
" origin/candidates", "hsh_to_tag"), " origin/candidates", "hsh_to_tag"),
Cmd("git tag 3.22.5 hsh_to_tag", ""), Cmd("git tag 3.22.5 hsh_to_tag", ""),
Cmd("git push origin 3.22.5", ""), Cmd("git push origin refs/tags/3.22.5:refs/tags/3.22.5", ""),
Cmd("git checkout -f origin/master", ""), Cmd("git checkout -f origin/master", ""),
Cmd("git branch -D %s" % TEST_CONFIG["BRANCHNAME"], ""), Cmd("git branch -D %s" % TEST_CONFIG["BRANCHNAME"], ""),
Cmd("git branch -D %s" % TEST_CONFIG["CANDIDATESBRANCH"], ""), Cmd("git branch -D %s" % TEST_CONFIG["CANDIDATESBRANCH"], ""),
...@@ -905,7 +905,9 @@ Performance and stability improvements on all platforms.""" ...@@ -905,7 +905,9 @@ Performance and stability improvements on all platforms."""
Log text 1 (issue 321). Log text 1 (issue 321).
Performance and stability improvements on all platforms.""" Performance and stability improvements on all platforms.
TBR=reviewer@chromium.org"""
def ResetChangeLog(): def ResetChangeLog():
last_change_log = """1999-04-05: Version 3.22.4 last_change_log = """1999-04-05: Version 3.22.4
...@@ -969,12 +971,14 @@ Performance and stability improvements on all platforms.""" ...@@ -969,12 +971,14 @@ Performance and stability improvements on all platforms."""
cb=self.WriteFakeWatchlistsFile), cb=self.WriteFakeWatchlistsFile),
Cmd("git commit -aF \"%s\"" % TEST_CONFIG["COMMITMSG_FILE"], "", Cmd("git commit -aF \"%s\"" % TEST_CONFIG["COMMITMSG_FILE"], "",
cb=CheckVersionCommit), cb=CheckVersionCommit),
Cmd("git cl upload --send-mail --email \"author@chromium.org\" "
"-f --bypass-hooks", ""),
Cmd("git cl land --bypass-hooks -f", ""), Cmd("git cl land --bypass-hooks -f", ""),
Cmd("git fetch", ""), Cmd("git fetch", ""),
Cmd("git log -1 --format=%H --grep=" Cmd("git log -1 --format=%H --grep="
"\"Version 3.22.5\" origin/3.22.5", "hsh_to_tag"), "\"Version 3.22.5\" origin/3.22.5", "hsh_to_tag"),
Cmd("git tag 3.22.5 hsh_to_tag", ""), Cmd("git tag 3.22.5 hsh_to_tag", ""),
Cmd("git push origin 3.22.5", ""), Cmd("git push origin refs/tags/3.22.5:refs/tags/3.22.5", ""),
Cmd("git checkout -f origin/master", ""), Cmd("git checkout -f origin/master", ""),
Cmd("git branch", "* master\n work-branch\n"), Cmd("git branch", "* master\n work-branch\n"),
Cmd("git branch -D work-branch", ""), Cmd("git branch -D work-branch", ""),
...@@ -1288,7 +1292,7 @@ LOG=N ...@@ -1288,7 +1292,7 @@ LOG=N
"\" refs/remotes/origin/candidates", "\" refs/remotes/origin/candidates",
"hsh_to_tag"), "hsh_to_tag"),
Cmd("git tag 3.22.5.1 hsh_to_tag", ""), Cmd("git tag 3.22.5.1 hsh_to_tag", ""),
Cmd("git push origin 3.22.5.1", ""), Cmd("git push origin refs/tags/3.22.5.1:refs/tags/3.22.5.1", ""),
Cmd("git checkout -f origin/master", ""), Cmd("git checkout -f origin/master", ""),
Cmd("git branch -D %s" % TEST_CONFIG["BRANCHNAME"], ""), Cmd("git branch -D %s" % TEST_CONFIG["BRANCHNAME"], ""),
]) ])
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment