diff options
author | Linn Crosetto <linn@hpe.com> | 2016-09-21 15:59:00 -0600 |
---|---|---|
committer | Guido Günther <agx@sigxcpu.org> | 2016-10-02 19:35:58 +0200 |
commit | c1b32fa62ee252e4cffb92a64b162ad8f98ca27a (patch) | |
tree | 5564638f5f942c00504f5abd0218390288670a96 /gbp | |
parent | f87c21c517a1353424c06d3b1ff7b405bcb9a0a6 (diff) |
dch: avoid adding section in snapshot mode if distribution is UNRELEASED
When using git-dch in snapshot mode, a section is added without checking
whether the distribution is set to UNRELEASED. If the distribution is
UNRELEASED, the version will be incremented but a new section will not be
added, resulting in a skipped version in the changelog.
Change this behavior to add a new section in snapshot mode only if the
distribution is not set to UNRELEASED.
Signed-off-by: Linn Crosetto <linn@hpe.com>
Closes: #838714
Diffstat (limited to 'gbp')
-rw-r--r-- | gbp/scripts/dch.py | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/gbp/scripts/dch.py b/gbp/scripts/dch.py index 2ccbacbd..d716fbac 100644 --- a/gbp/scripts/dch.py +++ b/gbp/scripts/dch.py @@ -466,6 +466,7 @@ def main(argv): options=options.git_log.split(" ")) commits.reverse() + add_section = False # add a new changelog section if: if (options.new_version or options.bpo or options.nmu or options.qa or options.team or options.security): @@ -483,14 +484,13 @@ def main(argv): version_change['version'] = options.new_version # the user wants to force a new version add_section = True - elif cp['Distribution'] != "UNRELEASED" and not found_snapshot_banner and commits: - # the last version was a release and we have pending commits - add_section = True - elif options.snapshot and not found_snapshot_banner: - # the user want to switch to snapshot mode - add_section = True - else: - add_section = False + elif cp['Distribution'] != "UNRELEASED" and not found_snapshot_banner: + if commits: + # the last version was a release and we have pending commits + add_section = True + if options.snapshot: + # the user want to switch to snapshot mode + add_section = True if add_section and not version_change and not source.is_native(): # Get version from upstream if none provided |