Fix progress check in auto-roller.

Using a git range check for checking progress is wrong when
the last rolled revision and the revision candidate are on
different branches. The range A..B will always show the
commits from the merge-base of A and B until B.

Better compare the tags of the last rolled revision and the
candidate. The candidate's version must be strictly greater
than what's in chromium.

TBR=tandrii@chromium.org
NOTRY=true
TEST=./script_test.py

Review URL: https://codereview.chromium.org/979133002

Cr-Commit-Position: refs/heads/master@{#27021}
This commit is contained in:
machenbach 2015-03-05 06:04:59 -08:00 committed by Commit bot
parent ce45b00e4b
commit f96e226011
2 changed files with 11 additions and 6 deletions

View File

@ -56,6 +56,8 @@ class DetectLastRoll(Step):
# The revision rolled last.
self["last_roll"] = vars['v8_revision']
last_version = self.GetVersionTag(self["last_roll"])
assert last_version, "The last rolled v8 revision is not tagged."
# There must be some progress between the last roll and the new candidate
# revision (i.e. we don't go backwards). The revisions are ordered newest
@ -63,9 +65,10 @@ class DetectLastRoll(Step):
# compared to the last roll, i.e. if the newest release is a cherry-pick
# on a release branch. Then we look further.
for revision in revisions:
commits = self.GitLog(
format="%H", git_hash="%s..%s" % (self["last_roll"], revision))
if commits:
version = self.GetVersionTag(revision)
assert version, "Internal error. All recent releases should have a tag"
if SortingKey(last_version) < SortingKey(version):
self["roll"] = revision
break
else:

View File

@ -1115,8 +1115,9 @@ deps = {
Cmd("git describe --tags bad_tag", ""),
Cmd("git describe --tags hash_234", "3.22.4"),
Cmd("git describe --tags hash_123", "3.22.3"),
Cmd("git log --format=%H abcd123455..hash_234", ""),
Cmd("git log --format=%H abcd123455..hash_123", ""),
Cmd("git describe --tags abcd123455", "3.22.4"),
Cmd("git describe --tags hash_234", "3.22.4"),
Cmd("git describe --tags hash_123", "3.22.3"),
])
result = auto_roll.AutoRoll(TEST_CONFIG, self).Run(
@ -1137,7 +1138,8 @@ deps = {
Cmd("git describe --tags bad_tag", ""),
Cmd("git describe --tags hash_234", "3.22.4"),
Cmd("git describe --tags hash_123", "3.22.3"),
Cmd("git log --format=%H abcd123455..hash_234", "hash1\nhash2\n"),
Cmd("git describe --tags abcd123455", "3.22.3.1"),
Cmd("git describe --tags hash_234", "3.22.4"),
])
result = auto_roll.AutoRoll(TEST_CONFIG, self).Run(