aboutsummaryrefslogtreecommitdiffhomepage
path: root/git-dch
diff options
context:
space:
mode:
authorGuido Guenther <agx@sigxcpu.org>2008-09-07 18:38:36 +0200
committerGuido Guenther <agx@sigxcpu.org>2008-09-07 22:44:50 +0200
commit0a34c3bc51c9c250a1154bbddd593a85ff50beaa (patch)
tree35fa1e3292321ee6cdc6a06cacbc0c3c1bf953fb /git-dch
parent162356033c6e93d7db5627acc2dd5e2ae68d23ce (diff)
add --new-version
Diffstat (limited to 'git-dch')
-rwxr-xr-xgit-dch14
1 files changed, 11 insertions, 3 deletions
diff --git a/git-dch b/git-dch
index f0d6117a..122d215b 100755
--- a/git-dch
+++ b/git-dch
@@ -50,9 +50,13 @@ def add_changelog_entry(msg, author, email):
system(cmd)
-def add_changelog_section(msg, distribution):
+def add_changelog_section(msg, distribution, newversion=None):
"add a new changelog section"
- cmd = "dch --no-auto-nmu --distribution=%s -i %s" % (distribution, msg)
+ if newversion:
+ versionopt = '--newversion=%s' % newversion
+ else:
+ versionopt = '-i'
+ cmd = "dch --no-auto-nmu --distribution=%s %s %s" % (distribution, versionopt, msg)
system(cmd)
@@ -249,6 +253,8 @@ def main(argv):
help="mark as release")
version_group.add_option("-S", "--snapshot", action="store_true", dest="snapshot", default=False,
help="mark as snapshot build")
+ version_group.add_option("-N", "--new-version", dest="new_version",
+ help="use this as base for the new version number")
commit_group.add_config_file_option(option_name="meta", dest="meta",
help="parse meta tags in commit messages, default is '%(meta)s'", action="store_true")
commit_group.add_config_file_option(option_name="meta-closes", dest="meta_closes",
@@ -300,7 +306,9 @@ def main(argv):
print "Only looking for changes on '%s'" % " ".join(args)
commits = repo.commits(since, until, " ".join(args), options.git_log.split(" "))
if commits:
- if cp['Distribution'] != "UNRELEASED" and not found_snapshot_header:
+ if options.new_version:
+ add_changelog_section(distribution="UNRELEASED", msg="UNRELEASED", newversion=options.new_version)
+ elif cp['Distribution'] != "UNRELEASED" and not found_snapshot_header:
add_changelog_section(distribution="UNRELEASED", msg="UNRELEASED")
shortlog_to_dch(repo, commits, options)
fixup_trailer()