diff options
author | W. Trevor King <wking@drexel.edu> | 2009-12-05 04:11:39 -0500 |
---|---|---|
committer | W. Trevor King <wking@drexel.edu> | 2009-12-05 04:11:39 -0500 |
commit | fbb8504a6c0438e90b046e44a60608159f4e3f63 (patch) | |
tree | 23358fae96603fd1a92ead1256f40456c7c02512 /becommands | |
parent | e95de5d97dc05ce5dbb9a553d5e42e437ceccbbf (diff) | |
download | bugseverywhere-fbb8504a6c0438e90b046e44a60608159f4e3f63.tar.gz |
Created diff.subscriptions_from_string()
Diffstat (limited to 'becommands')
-rw-r--r-- | becommands/diff.py | 16 |
1 files changed, 5 insertions, 11 deletions
diff --git a/becommands/diff.py b/becommands/diff.py index 5a94462..e2ff052 100644 --- a/becommands/diff.py +++ b/becommands/diff.py @@ -63,17 +63,11 @@ def execute(args, manipulate_encodings=True, restrict_file_access=False): revision = args[0] if len(args) > 1: raise cmdutil.UsageError('Too many arguments.') - if options.subscribe == None: - subscriptions = [diff.Subscription(diff.BUGDIR_ID, - diff.BUGDIR_TYPE_ALL)] - else: - subscriptions = [] - for subscription in options.subscribe.split(','): - fields = subscription.split(':') - if len(fields) != 2: - raise cmdutil.UsageError('Invalid subscription "%s", should be ID:TYPE') - id,type = fields - subscriptions.append(diff.Subscription(id, type)) + try: + subscriptions = diff.subscriptions_from_string( + options.subscribe) + except ValueError, e: + raise cmdutil.UsageError(e.msg) bd = bugdir.BugDir(from_disk=True, manipulate_encodings=manipulate_encodings) if bd.vcs.versioned == False: |