diff options
author | Conley Owens <cco3@android.com> | 2012-04-16 10:36:08 -0700 |
---|---|---|
committer | Shawn O. Pearce <sop@google.com> | 2012-04-23 12:39:05 -0700 |
commit | 971de8ea7b7e474a4d9253b6c9f47da3f1130973 (patch) | |
tree | d8ac52741957b38d57d15f208e57b984d71ddc19 /command.py | |
parent | 24c130884018364f91baa8de0ff3541f4c32d1bb (diff) | |
download | git-repo-971de8ea7b7e474a4d9253b6c9f47da3f1130973.tar.gz |
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
Diffstat (limited to 'command.py')
-rw-r--r-- | command.py | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -58,7 +58,7 @@ class Command(object): | |||
58 | """Perform the action, after option parsing is complete. | 58 | """Perform the action, after option parsing is complete. |
59 | """ | 59 | """ |
60 | raise NotImplementedError | 60 | raise NotImplementedError |
61 | 61 | ||
62 | def GetProjects(self, args, missing_ok=False): | 62 | def GetProjects(self, args, missing_ok=False): |
63 | """A list of projects that match the arguments. | 63 | """A list of projects that match the arguments. |
64 | """ | 64 | """ |
@@ -68,8 +68,9 @@ class Command(object): | |||
68 | mp = self.manifest.manifestProject | 68 | mp = self.manifest.manifestProject |
69 | 69 | ||
70 | groups = mp.config.GetString('manifest.groups') | 70 | groups = mp.config.GetString('manifest.groups') |
71 | if groups: | 71 | if groups is None: |
72 | groups = re.split('[,\s]+', groups) | 72 | groups = 'default' |
73 | groups = [x for x in re.split('[,\s]+', groups) if x] | ||
73 | 74 | ||
74 | if not args: | 75 | if not args: |
75 | for project in all.values(): | 76 | for project in all.values(): |