rpm-ch: implement '--all' option
authorMarkus Lehtonen <markus.lehtonen@linux.intel.com>
Fri, 16 May 2014 11:26:49 +0000 (14:26 +0300)
committerMarkus Lehtonen <markus.lehtonen@linux.intel.com>
Fri, 14 Nov 2014 12:47:19 +0000 (14:47 +0200)
If defined, git-rpm-ch uses all commits in the Git history. Also,
'--since' option is omitted.

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
gbp/scripts/rpm_ch.py

index 14683f3..09586d0 100755 (executable)
@@ -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",