diff options
Diffstat (limited to 'command.py')
| -rw-r--r-- | command.py | 13 |
1 files changed, 12 insertions, 1 deletions
| @@ -15,9 +15,11 @@ | |||
| 15 | 15 | ||
| 16 | import os | 16 | import os |
| 17 | import optparse | 17 | import optparse |
| 18 | import re | ||
| 18 | import sys | 19 | import sys |
| 19 | 20 | ||
| 20 | from error import NoSuchProjectError | 21 | from error import NoSuchProjectError |
| 22 | from error import InvalidProjectGroupsError | ||
| 21 | 23 | ||
| 22 | class Command(object): | 24 | class 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 | ||
