aboutsummaryrefslogtreecommitdiffstats
path: root/becommands
diff options
context:
space:
mode:
Diffstat (limited to 'becommands')
-rw-r--r--becommands/tag.py12
1 files changed, 8 insertions, 4 deletions
diff --git a/becommands/tag.py b/becommands/tag.py
index 0b19e91..b8030f3 100644
--- a/becommands/tag.py
+++ b/becommands/tag.py
@@ -61,6 +61,11 @@ def execute(args, test=False):
>>> a = bd.bug_from_shortname("a")
>>> print a.extra_strings
[]
+ >>> execute(["a", "Alphabetically first"], test=True)
+ Tagging bug a:
+ Alphabetically first
+ >>> execute(["--remove", "a", "Alphabetically first"], test=True)
+ Tags for a:
"""
parser = get_parser()
options, args = parser.parse_args(args)
@@ -79,7 +84,6 @@ def execute(args, test=False):
new_tag = None
if len(args) == 2:
given_tag = args[1]
- # reassign list so the change_hook realizes we've altered it.
tags = bug.extra_strings
tag_string = "TAG:%s" % given_tag
if options.remove == True:
@@ -87,15 +91,15 @@ def execute(args, test=False):
else: # add the tag
new_tag = given_tag
tags.append(tag_string)
- bug.extra_strings = tags
+ bug.extra_strings = tags # reassign to notice change
+
+ bug.save()
tags = []
for estr in bug.extra_strings:
if estr.startswith("TAG:"):
tags.append(estr[4:])
- bd.save()
-
if new_tag == None:
print "Tags for %s:" % bug.uuid
else: