summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOwen W. Taylor <otaylor@fishsoup.net>2011-09-12 16:02:49 -0400
committerOwen W. Taylor <otaylor@fishsoup.net>2011-09-12 16:02:49 -0400
commit4fd0cc46dcca81f7fb503cb9e5be340f9366b7c5 (patch)
tree3e777c3b3edc3a7566939dd12590d666d0380e7f
parent3172fcbd5c9e300091dd60b1f96dc2aeb5a5fdf9 (diff)
Catch trying to refile an already filed bug
If 'git bz file' is used with a commit message that contains a bug reference, prompt before filing again. https://bugzilla.gnome.org/show_bug.cgi?id=624461
-rwxr-xr-xgit-bz11
1 files changed, 11 insertions, 0 deletions
diff --git a/git-bz b/git-bz
index 0c5a3e4..d5248e4 100755
--- a/git-bz
+++ b/git-bz
@@ -1965,6 +1965,17 @@ def do_file(*args):
commits = get_commits(commit_or_revision_range)
+ bug_references = [c for c in extract_and_collate_bugs(commits)]
+ if len(bug_references) > 0:
+ print ("Found existing bug reference%s in commit message%s:" %
+ ("" if len(bug_references) == 1 else "s",
+ "" if len(commits) == 1 else "s"))
+ for reference, _ in bug_references:
+ print " ", reference.get_url()
+ if not prompt("File anyway?"):
+ print "Aborting"
+ sys.exit(0)
+
if global_options.add_url:
check_add_url(commits, is_add_url=False)