diff options
-rwxr-xr-x | git-bz | 7 | ||||
-rw-r--r-- | git-bz.txt | 5 |
2 files changed, 11 insertions, 1 deletions
@@ -1725,7 +1725,8 @@ def edit_attachment_comment(bug, initial_description, initial_body): template.write("\n\n") if len(bug.patches) > 0: for patch in bug.patches: - template.write("#Obsoletes: %d - %s\n" % (patch.attach_id, patch.description)) + obsoleted = (initial_description == patch.description) + template.write("%sObsoletes: %d - %s\n" % ("" if obsoleted else "#", patch.attach_id, patch.description)) template.write("\n") template.write("""# Please edit the description (first line) and comment (other lines). Lines @@ -1771,6 +1772,10 @@ def attach_commits(bug, commits, include_comments=True, edit_comments=False, sta else: description = commit.subject obsoletes = [] + for attachment in bug.patches: + if attachment.description == commit.subject: + obsoletes.append(attachment.attach_id) + bug.create_patch(description, body, filename, patch, obsoletes=obsoletes, status=status) def do_attach(*args): @@ -187,6 +187,11 @@ to the bug (see 'git bz add-url'). This can be suppressed with the allow the user to edit the description and comment for each patch, and (by uncommenting lines) obsolete old patches. +When a commit with the same subject as an existing patch is attached, +this is interpreted as a new version of the existing patch and the old +patch is obsoleted. (With '-e', the obsoletes line can be commented +to suppress this.) + Examples: ---------------------------------------- # Attach the last commit |