diff options
author | Guido Günther <agx@sigxcpu.org> | 2009-08-23 18:00:40 +0200 |
---|---|---|
committer | Guido Günther <agx@sigxcpu.org> | 2009-09-05 15:12:55 +0200 |
commit | 98a9b8881383e49f53ac89b44e7a4368929ac82e (patch) | |
tree | e81e4ad006c10cee2a8eae80701b1e55a2fbc573 /git-dch | |
parent | 52d9b5a807753608d2081f58f71c36a3471a3444 (diff) |
Add changelog section if current topmost version is already tagged.
This makes sure we add a new changelog section after a release. This was
broken due to 016318.
Diffstat (limited to 'git-dch')
-rwxr-xr-x | git-dch | 18 |
1 files changed, 15 insertions, 3 deletions
@@ -244,15 +244,27 @@ def shortlog_to_dch(repo, commits, options): add_changelog_entry(msg, author, email) -def guess_snapshot_commit(cp, repo): - """guess the last commit documented in the changelog from the snapshot banner""" +def guess_snapshot_commit(cp, repo, options): + """ + guess the last commit documented in the changelog from the snapshot banner + or the last point the changelog was touched. + """ sr = re.search(snapshot_re, cp['Changes']) if sr: return sr.group('commit') + # If the current topmost changelog entry has already been tagged rely on + # the version information only. The upper level relies then on the version + # info anyway: + tag = build_tag(options.debian_tag, cp['Version']) + if repo.has_tag(tag): + return None + # If we didn't find a snapshot header we look at the point the changelog + # was last touched. last = repo.commits(paths="debian/changelog", options=["-1"]) if last: print "Changelog last touched at '%s'" % last[0] return last[0] + return None def main(argv): @@ -328,7 +340,7 @@ def main(argv): else: since = '' if options.auto: - since = guess_snapshot_commit(cp, repo) + since = guess_snapshot_commit(cp, repo, options) if since: print "Continuing from commit '%s'" % since found_snapshot_header = True |