summaryrefslogtreecommitdiffstats
path: root/project.py
diff options
context:
space:
mode:
Diffstat (limited to 'project.py')
-rw-r--r--project.py15
1 files changed, 8 insertions, 7 deletions
diff --git a/project.py b/project.py
index 06baccb5..60633b73 100644
--- a/project.py
+++ b/project.py
@@ -632,20 +632,21 @@ class Project(object):
632 """Returns true if the manifest groups specified at init should cause 632 """Returns true if the manifest groups specified at init should cause
633 this project to be synced. 633 this project to be synced.
634 Prefixing a manifest group with "-" inverts the meaning of a group. 634 Prefixing a manifest group with "-" inverts the meaning of a group.
635 All projects are implicitly labelled with "default". 635 All projects are implicitly labelled with "all".
636 636
637 labels are resolved in order. In the example case of 637 labels are resolved in order. In the example case of
638 project_groups: "default,group1,group2" 638 project_groups: "all,group1,group2"
639 manifest_groups: "-group1,group2" 639 manifest_groups: "-group1,group2"
640 the project will be matched. 640 the project will be matched.
641 """ 641 """
642 if self.groups is None: 642 expanded_manifest_groups = manifest_groups or ['all', '-notdefault']
643 return True 643 expanded_project_groups = ['all'] + (self.groups or [])
644
644 matched = False 645 matched = False
645 for group in manifest_groups: 646 for group in expanded_manifest_groups:
646 if group.startswith('-') and group[1:] in self.groups: 647 if group.startswith('-') and group[1:] in expanded_project_groups:
647 matched = False 648 matched = False
648 elif group in self.groups: 649 elif group in expanded_project_groups:
649 matched = True 650 matched = True
650 651
651 return matched 652 return matched