diff --git a/ubuntutools/sponsor_patch/source_package.py b/ubuntutools/sponsor_patch/source_package.py index b910aff..dbfef6f 100644 --- a/ubuntutools/sponsor_patch/source_package.py +++ b/ubuntutools/sponsor_patch/source_package.py @@ -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() diff --git a/ubuntutools/sponsor_patch/sponsor_patch.py b/ubuntutools/sponsor_patch/sponsor_patch.py index cae3bd1..fce896d 100644 --- a/ubuntutools/sponsor_patch/sponsor_patch.py +++ b/ubuntutools/sponsor_patch/sponsor_patch.py @@ -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