diff options
| author | Graham Christensen <graham@grahamc.com> | 2015-07-29 17:02:54 -0500 |
|---|---|---|
| committer | Graham Christensen <graham@grahamc.com> | 2015-07-30 12:59:35 -0500 |
| commit | 0369a069ade1602879c16dd33dc592bed3f17c0f (patch) | |
| tree | 96d4f4970bc5d0b3ba7fcdca5946e47e170ff2bc /command.py | |
| parent | abaa7f312f1b6c8d11d7c757fe909900ce5788b5 (diff) | |
| download | git-repo-0369a069ade1602879c16dd33dc592bed3f17c0f.tar.gz | |
Support filtering by group on forall and list subcmd
Enable operating against groups of repositories. As it stands, it isn't
compatible with `-r/--regex`.
`repo forall -g groupname -c pwd` will run `pwd` for all projects in
groupname.
`repo forall -g thisgroup,-butnotthisone -c pwd` will run `pwd` for all
projects in `thisgroup` but not `butnotthisone`.
`repo list -g groupname -n` will list all the names of repos in
`groupname`.
Change-Id: Ia75c50ce52541d1c8cea2874b20a4db2e0e54960
Diffstat (limited to 'command.py')
| -rw-r--r-- | command.py | 5 |
1 files changed, 3 insertions, 2 deletions
| @@ -126,7 +126,7 @@ class Command(object): | |||
| 126 | pass | 126 | pass |
| 127 | return project | 127 | return project |
| 128 | 128 | ||
| 129 | def GetProjects(self, args, missing_ok=False, submodules_ok=False): | 129 | def GetProjects(self, args, groups='', missing_ok=False, submodules_ok=False): |
| 130 | """A list of projects that match the arguments. | 130 | """A list of projects that match the arguments. |
| 131 | """ | 131 | """ |
| 132 | all_projects_list = self.manifest.projects | 132 | all_projects_list = self.manifest.projects |
| @@ -134,7 +134,8 @@ class Command(object): | |||
| 134 | 134 | ||
| 135 | mp = self.manifest.manifestProject | 135 | mp = self.manifest.manifestProject |
| 136 | 136 | ||
| 137 | groups = mp.config.GetString('manifest.groups') | 137 | if not groups: |
| 138 | groups = mp.config.GetString('manifest.groups') | ||
| 138 | if not groups: | 139 | if not groups: |
| 139 | groups = 'default,platform-' + platform.system().lower() | 140 | groups = 'default,platform-' + platform.system().lower() |
| 140 | groups = [x for x in re.split(r'[,\s]+', groups) if x] | 141 | groups = [x for x in re.split(r'[,\s]+', groups) if x] |
