From 049b4ad5e401f1a31954e171c28df93fc86faa30 Mon Sep 17 00:00:00 2001 From: "machenbach@chromium.org" Date: Mon, 21 Jul 2014 12:13:36 +0000 Subject: [PATCH] Fix automatic version update. This fixes two things: 1. Guarantee that versions are bumped up also when presubmit errors exists. Those errors originate from other CLs and should not stop the automatic versioning. 2. Calculate the last bleeding edge version when pushing to trunk based on remote branch svn/bleeding_edge and not on local branch master. The master branch is not kept up-to-date by the script. BUG= TBR=jarin@chromium.org Review URL: https://codereview.chromium.org/404093002 git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@22501 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- tools/push-to-trunk/bump_up_version.py | 3 ++- tools/push-to-trunk/git_recipes.py | 5 ++++- tools/push-to-trunk/push_to_trunk.py | 2 +- tools/push-to-trunk/test_scripts.py | 7 ++++--- 4 files changed, 11 insertions(+), 6 deletions(-) diff --git a/tools/push-to-trunk/bump_up_version.py b/tools/push-to-trunk/bump_up_version.py index 31d834f..af5f73a 100755 --- a/tools/push-to-trunk/bump_up_version.py +++ b/tools/push-to-trunk/bump_up_version.py @@ -199,7 +199,8 @@ class ChangeVersion(Step): self.GitCommit("[Auto-roll] Bump up version to %s\n\nTBR=%s" % (self["new_version"], self._options.author)) self.GitUpload(author=self._options.author, - force=self._options.force_upload) + force=self._options.force_upload, + bypass_hooks=True) self.GitDCommit() print "Successfully changed the version." finally: diff --git a/tools/push-to-trunk/git_recipes.py b/tools/push-to-trunk/git_recipes.py index 094a5b0..6ffb2da 100644 --- a/tools/push-to-trunk/git_recipes.py +++ b/tools/push-to-trunk/git_recipes.py @@ -147,7 +147,8 @@ class GitRecipesMixin(object): args.append(Quoted(patch_file)) self.Git(MakeArgs(args)) - def GitUpload(self, reviewer="", author="", force=False, cq=False): + def GitUpload(self, reviewer="", author="", force=False, cq=False, + bypass_hooks=False): args = ["cl upload --send-mail"] if author: args += ["--email", Quoted(author)] @@ -157,6 +158,8 @@ class GitRecipesMixin(object): args.append("-f") if cq: args.append("--use-commit-queue") + if bypass_hooks: + args.append("--bypass-hooks") # TODO(machenbach): Check output in forced mode. Verify that all required # base files were uploaded, if not retry. self.Git(MakeArgs(args), pipe=False) diff --git a/tools/push-to-trunk/push_to_trunk.py b/tools/push-to-trunk/push_to_trunk.py index f6dcf2e..c05f748 100755 --- a/tools/push-to-trunk/push_to_trunk.py +++ b/tools/push-to-trunk/push_to_trunk.py @@ -130,7 +130,7 @@ class GetCurrentBleedingEdgeVersion(Step): MESSAGE = "Get latest bleeding edge version." def RunStep(self): - self.GitCheckoutFile(self.Config(VERSION_FILE), "master") + self.GitCheckoutFile(self.Config(VERSION_FILE), "svn/bleeding_edge") # Store latest version. self.ReadAndPersistVersion("latest_") diff --git a/tools/push-to-trunk/test_scripts.py b/tools/push-to-trunk/test_scripts.py index abb2992..5f0fa19 100644 --- a/tools/push-to-trunk/test_scripts.py +++ b/tools/push-to-trunk/test_scripts.py @@ -755,8 +755,8 @@ Performance and stability improvements on all platforms.""", commit) Git("log -1 --format=%s hash2", "Version 3.4.5 (based on bleeding_edge revision r1234)\n"), Git("svn find-rev r1234", "hash3\n"), - Git("checkout -f master -- %s" % TEST_CONFIG[VERSION_FILE], "", - cb=self.WriteFakeVersionFile), + Git("checkout -f svn/bleeding_edge -- %s" % TEST_CONFIG[VERSION_FILE], + "", cb=self.WriteFakeVersionFile), Git("checkout -f hash2 -- %s" % TEST_CONFIG[VERSION_FILE], "", cb=self.WriteFakeVersionFile), Git("log --format=%H hash3..push_hash", "rev1\n"), @@ -1312,7 +1312,8 @@ LOG=N cb=ResetVersion(11, 4)), Git("commit -am \"[Auto-roll] Bump up version to 3.11.6.0\n\n" "TBR=author@chromium.org\"", ""), - Git("cl upload --send-mail --email \"author@chromium.org\" -f", ""), + Git("cl upload --send-mail --email \"author@chromium.org\" -f " + "--bypass-hooks", ""), Git("cl dcommit -f --bypass-hooks", ""), Git("checkout -f bleeding_edge", ""), Git("branch", "auto-bump-up-version\n* bleeding_edge"), -- 2.7.4