From 40859e85fc1690ad95a85e6adc7b7ef4e4157e49 Mon Sep 17 00:00:00 2001 From: Gianluca Montecchi Date: Wed, 24 Jun 2009 17:20:12 -0400 Subject: [PATCH] Add ability to list all current targets. From his Wed, 24 Jun 2009 23:08:25 +0200 email to the list: Hello As I noted some time ago, there is not a way to list all the present targets in the current repository. At the time, Chris send me a patch to have this feature, but it still not merged in the last revision (314). So this is a patch for this feature to apply against revision 314. It is basically a port of the old Chris's patch. bye Gianluca --- becommands/target.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/becommands/target.py b/becommands/target.py index c83ffa7..f18b0c0 100644 --- a/becommands/target.py +++ b/becommands/target.py @@ -36,9 +36,16 @@ def execute(args, test=False): options, args = parser.parse_args(args) cmdutil.default_complete(options, args, parser, bugid_args={0: lambda bug : bug.active==True}) + if len(args) not in (1, 2): raise cmdutil.UsageError bd = bugdir.BugDir(from_disk=True, manipulate_encodings=not test) + if len(args) == 1 and args[0] == 'list': + ts = set([bd.bug_from_uuid(bug).target for bug in bd.list_uuids()]) + for target in sorted(ts): + if target and isinstance(target,str): + print target + return bug = bd.bug_from_shortname(args[0]) if len(args) == 1: if bug.target is None or bug.target is settings_object.EMPTY: -- 2.26.2