summaryrefslogtreecommitdiffstats
path: root/command.py
diff options
context:
space:
mode:
Diffstat (limited to 'command.py')
-rw-r--r--command.py13
1 files changed, 12 insertions, 1 deletions
diff --git a/command.py b/command.py
index 8e93787e..724e4c5d 100644
--- a/command.py
+++ b/command.py
@@ -15,9 +15,11 @@
15 15
16import os 16import os
17import optparse 17import optparse
18import re
18import sys 19import sys
19 20
20from error import NoSuchProjectError 21from error import NoSuchProjectError
22from error import InvalidProjectGroupsError
21 23
22class Command(object): 24class Command(object):
23 """Base class for any command line action in repo. 25 """Base class for any command line action in repo.
@@ -63,9 +65,16 @@ class Command(object):
63 all = self.manifest.projects 65 all = self.manifest.projects
64 result = [] 66 result = []
65 67
68 mp = self.manifest.manifestProject
69
70 groups = mp.config.GetString('manifest.groups')
71 if groups:
72 groups = re.split('[,\s]+', groups)
73
66 if not args: 74 if not args:
67 for project in all.values(): 75 for project in all.values():
68 if missing_ok or project.Exists: 76 if ((missing_ok or project.Exists) and
77 project.MatchesGroups(groups)):
69 result.append(project) 78 result.append(project)
70 else: 79 else:
71 by_path = None 80 by_path = None
@@ -102,6 +111,8 @@ class Command(object):
102 raise NoSuchProjectError(arg) 111 raise NoSuchProjectError(arg)
103 if not missing_ok and not project.Exists: 112 if not missing_ok and not project.Exists:
104 raise NoSuchProjectError(arg) 113 raise NoSuchProjectError(arg)
114 if not project.MatchesGroups(groups):
115 raise InvalidProjectGroupsError(arg)
105 116
106 result.append(project) 117 result.append(project)
107 118