From 33b4aa7fa455225f0057d636645a9e6b2774b9c6 Mon Sep 17 00:00:00 2001 From: Markus Lehtonen Date: Fri, 16 May 2014 14:26:49 +0300 Subject: [PATCH] rpm-ch: implement '--all' option If defined, git-rpm-ch uses all commits in the Git history. Also, '--since' option is omitted. Signed-off-by: Markus Lehtonen --- gbp/scripts/rpm_ch.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/gbp/scripts/rpm_ch.py b/gbp/scripts/rpm_ch.py index 14683f3..09586d0 100755 --- a/gbp/scripts/rpm_ch.py +++ b/gbp/scripts/rpm_ch.py @@ -232,7 +232,9 @@ def guess_commit(section, repo, options): def get_start_commit(changelog, repo, options): """Get the start commit from which to generate new entries""" - if options.since: + if options.all: + since = None + elif options.since: since = options.since else: if changelog.sections: @@ -241,7 +243,7 @@ def get_start_commit(changelog, repo, options): since = None if not since: raise GbpError("Couldn't determine starting point from " - "changelog, please use the '--since' option") + "changelog, please use the '--since' or '--all'") gbp.log.info("Continuing from commit '%s'" % since) return since @@ -414,6 +416,9 @@ def parse_args(argv): # Range group options range_grp.add_option("-s", "--since", dest="since", help="commit to start from (e.g. HEAD^^^, release/0.1.2)") + range_grp.add_option("--all", action="store_true", + help="use all commits from the Git history, overrides " + "--since") # Formatting group options format_grp.add_option("--no-release", action="store_false", default=True, dest="release", -- 2.7.4