aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGianluca Montecchi <gian@grys.it>2009-06-24 17:20:12 -0400
committerW. Trevor King <wking@drexel.edu>2009-06-24 17:20:12 -0400
commit40859e85fc1690ad95a85e6adc7b7ef4e4157e49 (patch)
treeff05922d6370abd0622de47b550641acc491b7f5
parent37195a33108299504f8d37042dec06df0540d0d2 (diff)
downloadbugseverywhere-40859e85fc1690ad95a85e6adc7b7ef4e4157e49.tar.gz
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
-rw-r--r--becommands/target.py7
1 files changed, 7 insertions, 0 deletions
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: