diff --git a/tools/release/auto_roll.py b/tools/release/auto_roll.py index 8d21280e3d..f7692cf6f9 100755 --- a/tools/release/auto_roll.py +++ b/tools/release/auto_roll.py @@ -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: diff --git a/tools/release/test_scripts.py b/tools/release/test_scripts.py index 68d30cd60b..aeb9c20ab7 100644 --- a/tools/release/test_scripts.py +++ b/tools/release/test_scripts.py @@ -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(