diff options
author | Chris Ball <cjb@laptop.org> | 2009-06-30 16:18:54 -0400 |
---|---|---|
committer | Chris Ball <cjb@laptop.org> | 2009-06-30 16:18:54 -0400 |
commit | 90e166a0f4220bc5b662f6c0dbdbf758263760e0 (patch) | |
tree | d7d5a56aa253ccb4b8f2086751caf587006572b3 /becommands | |
parent | acf7b0cc492142ef0bbf1c04aed652a53caf7fe1 (diff) | |
parent | 92b9b013ea13ea1278600488bc1ce65d226a92c8 (diff) | |
download | bugseverywhere-90e166a0f4220bc5b662f6c0dbdbf758263760e0.tar.gz |
Merge darcs support from W. Trevor King's tree.
Diffstat (limited to 'becommands')
-rw-r--r-- | becommands/comment.py | 3 | ||||
-rw-r--r-- | becommands/depend.py | 14 |
2 files changed, 15 insertions, 2 deletions
diff --git a/becommands/comment.py b/becommands/comment.py index b31a6e7..09f246a 100644 --- a/becommands/comment.py +++ b/becommands/comment.py @@ -93,7 +93,8 @@ def execute(args, test=False): raise cmdutil.UserError("No comment entered.") body = body.decode('utf-8') elif args[1] == '-': # read body from stdin - binary = not options.content_type.startswith("text/") + binary = not (options.content_type == None + or options.content_type.startswith("text/")) if not binary: body = sys.stdin.read() if not body.endswith('\n'): diff --git a/becommands/depend.py b/becommands/depend.py index 0e9ee97..58e4388 100644 --- a/becommands/depend.py +++ b/becommands/depend.py @@ -30,6 +30,9 @@ def execute(args, test=False): >>> execute(["a"], test=True) Blocks on a: b + >>> execute(["--show-status", "a"], test=True) # doctest: +NORMALIZE_WHITESPACE + Blocks on a: + b closed >>> execute(["-r", "a", "b"], test=True) """ parser = get_parser() @@ -60,7 +63,13 @@ def execute(args, test=False): depends = [] for estr in bugA.extra_strings: if estr.startswith("BLOCKED-BY:"): - depends.append(estr[11:]) + uuid = estr[11:] + if options.show_status == True: + blocker = bd.bug_from_uuid(uuid) + block_string = "%s\t%s" % (uuid, blocker.status) + else: + block_string = uuid + depends.append(block_string) if len(depends) > 0: print "Blocks on %s:" % bugA.uuid print '\n'.join(depends) @@ -69,6 +78,9 @@ def get_parser(): parser = cmdutil.CmdOptionParser("be depend BUG-ID [BUG-ID]") parser.add_option("-r", "--remove", action="store_true", dest="remove", help="Remove dependency (instead of adding it)") + parser.add_option("-s", "--show-status", action="store_true", + dest="show_status", + help="Show status of blocking bugs") return parser longhelp=""" |