From 0369a069ade1602879c16dd33dc592bed3f17c0f Mon Sep 17 00:00:00 2001 From: Graham Christensen Date: Wed, 29 Jul 2015 17:02:54 -0500 Subject: 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 --- subcmds/forall.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'subcmds/forall.py') diff --git a/subcmds/forall.py b/subcmds/forall.py index b93cd6d0..96dc99d1 100644 --- a/subcmds/forall.py +++ b/subcmds/forall.py @@ -120,6 +120,9 @@ without iterating through the remaining projects. p.add_option('-r', '--regex', dest='regex', action='store_true', help="Execute the command only on projects matching regex or wildcard expression") + p.add_option('-g', '--groups', + dest='groups', + help="Execute the command only on projects matching the specified groups") p.add_option('-c', '--command', help='Command (and arguments) to execute', dest='command', @@ -213,7 +216,7 @@ without iterating through the remaining projects. self.manifest.Override(smart_sync_manifest_path) if not opt.regex: - projects = self.GetProjects(args) + projects = self.GetProjects(args, groups=opt.groups) else: projects = self.FindProjects(args) -- cgit v1.2.3-54-g00ecf