aboutsummaryrefslogtreecommitdiffstats
path: root/becommands/show.py
diff options
context:
space:
mode:
Diffstat (limited to 'becommands/show.py')
-rw-r--r--becommands/show.py21
1 files changed, 7 insertions, 14 deletions
diff --git a/becommands/show.py b/becommands/show.py
index 94e16bf..4f8c30d 100644
--- a/becommands/show.py
+++ b/becommands/show.py
@@ -63,24 +63,17 @@ def execute(args, manipulate_encodings=True):
if options.XML:
print '<?xml version="1.0" encoding="%s" ?>' % bd.encoding
for shortname in args:
- if shortname.count(':') > 1:
- raise cmdutil.UserError("Invalid id '%s'." % shortname)
- elif shortname.count(':') == 1:
- # Split shortname generated by Comment.comment_shortnames()
- bugname = shortname.split(':')[0]
- is_comment = True
- else:
- bugname = shortname
- is_comment = False
- if is_comment == True and options.comments == False:
- continue
- bug = cmdutil.bug_from_shortname(bd, bugname)
- if is_comment == False:
+ bugname,commname = cmdutil.parse_id(shortname)
+ if commname == None: # bug shortname
+ bug = cmdutil.bug_from_id(bd, shortname)
if options.XML:
print bug.xml(show_comments=options.comments)
else:
print bug.string(show_comments=options.comments)
- else:
+ elif options.comments == False:
+ continue
+ else: # comment shortname
+ bug,comment = cmdutil.bug_comment_from_id(shortname)
comment = bug.comment_root.comment_from_shortname(
shortname, bug_shortname=bugname)
if options.XML: