From: Gianluca Montecchi Date: Wed, 24 Jun 2009 21:20:12 +0000 (-0400) Subject: Add ability to list all current targets. X-Git-Tag: 1.0.0~71^2~2 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=40859e85fc1690ad95a85e6adc7b7ef4e4157e49;p=be.git 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 --- 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: