summaryrefslogtreecommitdiffstats
path: root/subcmds/list.py
diff options
context:
space:
mode:
authorZhiguang Li <muzili@gmail.com>2013-03-15 10:32:10 +0800
committerChirayu Desai <cdesai@cyanogenmod.org>2013-04-29 16:19:26 +0530
commita8864fba9fd21f412cd0e2c6e072deeb204049bb (patch)
tree70008b8438542ff08fc9c5883e1b35f15c12b1c8 /subcmds/list.py
parent275e4b727a68cbf32c686d80736772c843771d98 (diff)
downloadgit-repo-a8864fba9fd21f412cd0e2c6e072deeb204049bb.tar.gz
Add regex support for subcommand forall
Filter the project list based on regex or wildcard matching of strings, then we can handle subset of all projects. Change-Id: Ib6c23aec79e7d981f7b6a5eb0ae93c44effec467 Signed-off-by: Zhiguang Li <muzili@gmail.com>
Diffstat (limited to 'subcmds/list.py')
-rw-r--r--subcmds/list.py12
1 files changed, 0 insertions, 12 deletions
diff --git a/subcmds/list.py b/subcmds/list.py
index 8eb06cdd..a3358245 100644
--- a/subcmds/list.py
+++ b/subcmds/list.py
@@ -14,7 +14,6 @@
14# limitations under the License. 14# limitations under the License.
15 15
16from __future__ import print_function 16from __future__ import print_function
17import re
18import sys 17import sys
19 18
20from command import Command, MirrorSafeCommand 19from command import Command, MirrorSafeCommand
@@ -83,14 +82,3 @@ This is similar to running: repo forall -c 'echo "$REPO_PATH : $REPO_PROJECT"'.
83 82
84 lines.sort() 83 lines.sort()
85 print('\n'.join(lines)) 84 print('\n'.join(lines))
86
87 def FindProjects(self, args):
88 result = []
89 for project in self.GetProjects(''):
90 for arg in args:
91 pattern = re.compile(r'%s' % arg, re.IGNORECASE)
92 if pattern.search(project.name) or pattern.search(project.relpath):
93 result.append(project)
94 break
95 result.sort(key=lambda project: project.relpath)
96 return result