From a8864fba9fd21f412cd0e2c6e072deeb204049bb Mon Sep 17 00:00:00 2001 From: Zhiguang Li Date: Fri, 15 Mar 2013 10:32:10 +0800 Subject: 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 --- subcmds/list.py | 12 ------------ 1 file changed, 12 deletions(-) (limited to 'subcmds/list.py') 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 @@ # limitations under the License. from __future__ import print_function -import re import sys from command import Command, MirrorSafeCommand @@ -83,14 +82,3 @@ This is similar to running: repo forall -c 'echo "$REPO_PATH : $REPO_PROJECT"'. lines.sort() print('\n'.join(lines)) - - def FindProjects(self, args): - result = [] - for project in self.GetProjects(''): - for arg in args: - pattern = re.compile(r'%s' % arg, re.IGNORECASE) - if pattern.search(project.name) or pattern.search(project.relpath): - result.append(project) - break - result.sort(key=lambda project: project.relpath) - return result -- cgit v1.2.3-54-g00ecf