diff options
author | Guido Guenther <agx@sigxcpu.org> | 2008-09-07 18:38:36 +0200 |
---|---|---|
committer | Guido Guenther <agx@sigxcpu.org> | 2008-09-07 22:44:50 +0200 |
commit | 0a34c3bc51c9c250a1154bbddd593a85ff50beaa (patch) | |
tree | 35fa1e3292321ee6cdc6a06cacbc0c3c1bf953fb | |
parent | 162356033c6e93d7db5627acc2dd5e2ae68d23ce (diff) |
add --new-version
-rwxr-xr-x | git-dch | 14 |
1 files changed, 11 insertions, 3 deletions
@@ -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() |