summaryrefslogtreecommitdiffstats
path: root/subcmds
diff options
context:
space:
mode:
Diffstat (limited to 'subcmds')
-rw-r--r--subcmds/forall.py5
-rw-r--r--subcmds/list.py5
-rw-r--r--subcmds/sync.py4
3 files changed, 11 insertions, 3 deletions
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.
120 p.add_option('-r', '--regex', 120 p.add_option('-r', '--regex',
121 dest='regex', action='store_true', 121 dest='regex', action='store_true',
122 help="Execute the command only on projects matching regex or wildcard expression") 122 help="Execute the command only on projects matching regex or wildcard expression")
123 p.add_option('-g', '--groups',
124 dest='groups',
125 help="Execute the command only on projects matching the specified groups")
123 p.add_option('-c', '--command', 126 p.add_option('-c', '--command',
124 help='Command (and arguments) to execute', 127 help='Command (and arguments) to execute',
125 dest='command', 128 dest='command',
@@ -213,7 +216,7 @@ without iterating through the remaining projects.
213 self.manifest.Override(smart_sync_manifest_path) 216 self.manifest.Override(smart_sync_manifest_path)
214 217
215 if not opt.regex: 218 if not opt.regex:
216 projects = self.GetProjects(args) 219 projects = self.GetProjects(args, groups=opt.groups)
217 else: 220 else:
218 projects = self.FindProjects(args) 221 projects = self.FindProjects(args)
219 222
diff --git a/subcmds/list.py b/subcmds/list.py
index 945c28d8..ca51c5f7 100644
--- a/subcmds/list.py
+++ b/subcmds/list.py
@@ -35,6 +35,9 @@ This is similar to running: repo forall -c 'echo "$REPO_PATH : $REPO_PROJECT"'.
35 p.add_option('-r', '--regex', 35 p.add_option('-r', '--regex',
36 dest='regex', action='store_true', 36 dest='regex', action='store_true',
37 help="Filter the project list based on regex or wildcard matching of strings") 37 help="Filter the project list based on regex or wildcard matching of strings")
38 p.add_option('-g', '--groups',
39 dest='groups',
40 help="Filter the project list based on the groups the project is in")
38 p.add_option('-f', '--fullpath', 41 p.add_option('-f', '--fullpath',
39 dest='fullpath', action='store_true', 42 dest='fullpath', action='store_true',
40 help="Display the full work tree path instead of the relative path") 43 help="Display the full work tree path instead of the relative path")
@@ -62,7 +65,7 @@ This is similar to running: repo forall -c 'echo "$REPO_PATH : $REPO_PROJECT"'.
62 sys.exit(1) 65 sys.exit(1)
63 66
64 if not opt.regex: 67 if not opt.regex:
65 projects = self.GetProjects(args) 68 projects = self.GetProjects(args, groups=opt.groups)
66 else: 69 else:
67 projects = self.FindProjects(args) 70 projects = self.FindProjects(args)
68 71
diff --git a/subcmds/sync.py b/subcmds/sync.py
index a8074a40..43d450be 100644
--- a/subcmds/sync.py
+++ b/subcmds/sync.py
@@ -314,7 +314,9 @@ later is required to fix a server side protocol bug.
314 pm.update() 314 pm.update()
315 except _FetchError: 315 except _FetchError:
316 err_event.set() 316 err_event.set()
317 except: 317 except Exception as e:
318 print('error: Cannot fetch %s (%s: %s)' \
319 % (project.name, type(e).__name__, str(e)), file=sys.stderr)
318 err_event.set() 320 err_event.set()
319 raise 321 raise
320 finally: 322 finally: