summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xgit-bz7
-rw-r--r--git-bz.txt5
2 files changed, 11 insertions, 1 deletions
diff --git a/git-bz b/git-bz
index 0554f16..1259d6f 100755
--- a/git-bz
+++ b/git-bz
@@ -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):
diff --git a/git-bz.txt b/git-bz.txt
index 9817120..02df8d1 100644
--- a/git-bz.txt
+++ b/git-bz.txt
@@ -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