sponsor-patch: Check version of sponsored sync request too.

This commit is contained in:
Benjamin Drung 2011-09-20 00:31:51 +02:00
parent 663cb5214f
commit ba472b71d9
2 changed files with 12 additions and 5 deletions

View File

@ -371,7 +371,11 @@ class SourcePackage(object):
print harvest.report()
def reload_changelog(self):
"""Reloads debian/changelog and update version."""
"""Reloads debian/changelog and updates the version.
Returns true if the changelog was reloaded successfully. Returns false
if the user wants to correct a broken changelog.
"""
# Check the changelog
self._changelog = debian.changelog.Changelog()

View File

@ -259,10 +259,13 @@ def sponsor_patch(bug_number, build, builder, edit, keyid, lpinstance, update,
source_package = SourcePackage(task.package, builder, workdir, branch)
if is_sync(bug) and not edit:
successful = True
source_package.reload_changelog()
source_package.check_sync_request_version(bug_number, task)
if build:
successful = source_package.reload_changelog()
if successful:
source_package.check_sync_request_version(bug_number, task)
successful = source_package.check_version(task.get_version())
if successful and build:
dist = UbuntuDistroInfo().devel()
successful = source_package.build(update, dist)
update = False