Merge "fix the logic for deciding what to show as the "current" series"

This commit is contained in:
Jenkins 2017-05-29 09:01:47 +00:00 committed by Gerrit Code Review
commit 5529882740
2 changed files with 13 additions and 2 deletions

View File

@ -887,7 +887,16 @@ class Scanner(object):
LOG.debug('looking at base of %s to stop scanning master',
branches[-1])
scan_stop_tag = self._get_branch_base(branches[-1])
earliest_version = current_version
# If there is a tag on this branch after the point
# where the earlier branch was created, then use that
# tag as the earliest version to show in the current
# "series". If there is no such tag, then go all the
# way to the base of that earlier branch.
try:
idx = versions_by_date.index(scan_stop_tag) + 1
earliest_version = versions_by_date[idx]
except IndexError:
earliest_version = scan_stop_tag
elif branch and stop_at_branch_base and not earliest_version:
# If branch is set and is not "master",
# then we want to stop at the version before the tag at the

View File

@ -612,7 +612,7 @@ class BasicTest(Base):
self.repo.git('tag', '-s', '-m', 'first tag', '1.0.0')
self._add_notes_file()
self.repo.git('tag', '-s', '-m', 'middle tag', '2.0.0')
self._add_notes_file()
f3 = self._add_notes_file()
self.repo.git('tag', '-s', '-m', 'last tag', '3.0.0')
self.repo.git('branch', 'stable/a')
f4 = self._add_notes_file()
@ -627,6 +627,7 @@ class BasicTest(Base):
}
self.assertEqual(
{'3.0.0-1': [f4],
'3.0.0': [f3],
},
results,
)
@ -1112,6 +1113,7 @@ class BranchTest(Base):
self.assertEqual(
{
'2.0.0-1': [f21],
'2.0.0': [self.f2],
},
results,
)