From 971de8ea7b7e474a4d9253b6c9f47da3f1130973 Mon Sep 17 00:00:00 2001 From: Conley Owens Date: Mon, 16 Apr 2012 10:36:08 -0700 Subject: Refine groups functionality Every project is in group "default". "-default" does not remove it from this project. All group names specified in the manifest are positive names as opposed to a mix of negative and positive. Specified groups are resolved in order. If init is supplied with --groups="group1,-group2", the following describes the project selection when syncing: * all projects in "group1" will be added, and * all projects in "group2" will be removed. Change-Id: I1df3dcdb64bbd4cd80d675f9b2d3becbf721f661 --- command.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'command.py') diff --git a/command.py b/command.py index 724e4c5d..2ee0a43a 100644 --- a/command.py +++ b/command.py @@ -58,7 +58,7 @@ class Command(object): """Perform the action, after option parsing is complete. """ raise NotImplementedError - + def GetProjects(self, args, missing_ok=False): """A list of projects that match the arguments. """ @@ -68,8 +68,9 @@ class Command(object): mp = self.manifest.manifestProject groups = mp.config.GetString('manifest.groups') - if groups: - groups = re.split('[,\s]+', groups) + if groups is None: + groups = 'default' + groups = [x for x in re.split('[,\s]+', groups) if x] if not args: for project in all.values(): -- cgit v1.2.3-54-g00ecf