diff options
Diffstat (limited to 'manifest_xml.py')
| -rw-r--r-- | manifest_xml.py | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/manifest_xml.py b/manifest_xml.py index 44538690..a250382f 100644 --- a/manifest_xml.py +++ b/manifest_xml.py | |||
| @@ -119,6 +119,12 @@ class XmlManifest(object): | |||
| 119 | def Save(self, fd, peg_rev=False): | 119 | def Save(self, fd, peg_rev=False): |
| 120 | """Write the current manifest out to the given file descriptor. | 120 | """Write the current manifest out to the given file descriptor. |
| 121 | """ | 121 | """ |
| 122 | mp = self.manifestProject | ||
| 123 | |||
| 124 | groups = mp.config.GetString('manifest.groups') | ||
| 125 | if groups: | ||
| 126 | groups = re.split('[,\s]+', groups) | ||
| 127 | |||
| 122 | doc = xml.dom.minidom.Document() | 128 | doc = xml.dom.minidom.Document() |
| 123 | root = doc.createElement('manifest') | 129 | root = doc.createElement('manifest') |
| 124 | doc.appendChild(root) | 130 | doc.appendChild(root) |
| @@ -167,6 +173,10 @@ class XmlManifest(object): | |||
| 167 | 173 | ||
| 168 | for p in sort_projects: | 174 | for p in sort_projects: |
| 169 | p = self.projects[p] | 175 | p = self.projects[p] |
| 176 | |||
| 177 | if not p.MatchesGroups(groups): | ||
| 178 | continue | ||
| 179 | |||
| 170 | e = doc.createElement('project') | 180 | e = doc.createElement('project') |
| 171 | root.appendChild(e) | 181 | root.appendChild(e) |
| 172 | e.setAttribute('name', p.name) | 182 | e.setAttribute('name', p.name) |
| @@ -190,6 +200,9 @@ class XmlManifest(object): | |||
| 190 | ce.setAttribute('dest', c.dest) | 200 | ce.setAttribute('dest', c.dest) |
| 191 | e.appendChild(ce) | 201 | e.appendChild(ce) |
| 192 | 202 | ||
| 203 | if p.groups: | ||
| 204 | e.setAttribute('groups', ','.join(p.groups)) | ||
| 205 | |||
| 193 | if self._repo_hooks_project: | 206 | if self._repo_hooks_project: |
| 194 | root.appendChild(doc.createTextNode('')) | 207 | root.appendChild(doc.createTextNode('')) |
| 195 | e = doc.createElement('repo-hooks') | 208 | e = doc.createElement('repo-hooks') |
| @@ -504,6 +517,12 @@ class XmlManifest(object): | |||
| 504 | else: | 517 | else: |
| 505 | rebase = rebase.lower() in ("yes", "true", "1") | 518 | rebase = rebase.lower() in ("yes", "true", "1") |
| 506 | 519 | ||
| 520 | groups = node.getAttribute('groups') | ||
| 521 | if groups: | ||
| 522 | groups = re.split('[,\s]+', groups) | ||
| 523 | else: | ||
| 524 | groups = None | ||
| 525 | |||
| 507 | if self.IsMirror: | 526 | if self.IsMirror: |
| 508 | relpath = None | 527 | relpath = None |
| 509 | worktree = None | 528 | worktree = None |
| @@ -520,7 +539,8 @@ class XmlManifest(object): | |||
| 520 | relpath = path, | 539 | relpath = path, |
| 521 | revisionExpr = revisionExpr, | 540 | revisionExpr = revisionExpr, |
| 522 | revisionId = None, | 541 | revisionId = None, |
| 523 | rebase = rebase) | 542 | rebase = rebase, |
| 543 | groups = groups) | ||
| 524 | 544 | ||
| 525 | for n in node.childNodes: | 545 | for n in node.childNodes: |
| 526 | if n.nodeName == 'copyfile': | 546 | if n.nodeName == 'copyfile': |
