From c429d979d43cd40179ace41f30eb15d5c43485fe Mon Sep 17 00:00:00 2001 From: Guido Günther Date: Mon, 13 Nov 2017 15:49:35 +0100 Subject: dch: make --auto the default The current default mode of looking at the version in the changelog only leads to problems when people build up the changelog incrementally. --auto mode handles this since many years so make this the default, there's still --since for finer control where to start from. Closes: #880552 --- gbp/scripts/dch.py | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/gbp/scripts/dch.py b/gbp/scripts/dch.py index f2cab82e..9aea564d 100644 --- a/gbp/scripts/dch.py +++ b/gbp/scripts/dch.py @@ -263,6 +263,9 @@ def process_options(options, parser): if options.since and options.auto: parser.error("'--since' and '--auto' are incompatible options") + if not options.since and not options.auto: + options.auto = True + dch_options = [] if options.multimaint_merge: dch_options.append("--multimaint-merge") @@ -452,19 +455,13 @@ def main(argv): if options.since: since = options.since else: - since = '' - if options.auto: - since = guess_documented_commit(cp, repo, options.debian_tag) - if since: - msg = "Continuing from commit '%s'" % since - else: - msg = "Starting from first commit" + since = guess_documented_commit(cp, repo, options.debian_tag) + if since: + msg = "Continuing from commit '%s'" % since + else: + msg = "Starting from first commit" gbp.log.info(msg) - found_snapshot_banner = has_snapshot_banner(cp) - else: # Fallback: continue from last tag - since = repo.find_version(options.debian_tag, cp['Version']) - if not since: - raise GbpError("Version %s not found" % cp['Version']) + found_snapshot_banner = has_snapshot_banner(cp) if args: gbp.log.info("Only looking for changes on '%s'" % " ".join(args)) -- cgit v1.2.3