summaryrefslogtreecommitdiffstats
path: root/project.py
diff options
context:
space:
mode:
authorConley Owens <cco3@android.com>2012-08-13 13:11:18 -0700
committergerrit code review <noreply-gerritcodereview@google.com>2012-09-05 11:46:48 -0700
commitbb1b5f5f863fca0e85764f5b35c117f5724d15c0 (patch)
tree0b6b8d0d6d027f2d0e0dd6fabdd4eafc6c919026 /project.py
parente2126652a3a1e08724a54091793bb29a79d31014 (diff)
downloadgit-repo-bb1b5f5f863fca0e85764f5b35c117f5724d15c0.tar.gz
Allow projects to be specified as notdefault
Instead of every group being in the group "default", every project is now in the group "all". A group that should not be downloaded by default may be added to the group "notdefault". This allows all group names to be positive (instead of removing groups directly in the manifest with -default) and offers a clear way of selecting every project (--groups all). Change-Id: I99cd70309adb1f8460db3bbc6eff46bdcd22256f
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