summaryrefslogtreecommitdiffstats
path: root/manifest_xml.py
diff options
context:
space:
mode:
Diffstat (limited to 'manifest_xml.py')
-rw-r--r--manifest_xml.py23
1 files changed, 23 insertions, 0 deletions
diff --git a/manifest_xml.py b/manifest_xml.py
index 9b5d7847..60d61168 100644
--- a/manifest_xml.py
+++ b/manifest_xml.py
@@ -63,6 +63,7 @@ class _Default(object):
63 sync_j = 1 63 sync_j = 1
64 sync_c = False 64 sync_c = False
65 sync_s = False 65 sync_s = False
66 sync_tags = True
66 67
67 def __eq__(self, other): 68 def __eq__(self, other):
68 return self.__dict__ == other.__dict__ 69 return self.__dict__ == other.__dict__
@@ -238,6 +239,9 @@ class XmlManifest(object):
238 if d.sync_s: 239 if d.sync_s:
239 have_default = True 240 have_default = True
240 e.setAttribute('sync-s', 'true') 241 e.setAttribute('sync-s', 'true')
242 if not d.sync_tags:
243 have_default = True
244 e.setAttribute('sync-tags', 'false')
241 if have_default: 245 if have_default:
242 root.appendChild(e) 246 root.appendChild(e)
243 root.appendChild(doc.createTextNode('')) 247 root.appendChild(doc.createTextNode(''))
@@ -327,6 +331,9 @@ class XmlManifest(object):
327 if p.sync_s: 331 if p.sync_s:
328 e.setAttribute('sync-s', 'true') 332 e.setAttribute('sync-s', 'true')
329 333
334 if not p.sync_tags:
335 e.setAttribute('sync-tags', 'false')
336
330 if p.clone_depth: 337 if p.clone_depth:
331 e.setAttribute('clone-depth', str(p.clone_depth)) 338 e.setAttribute('clone-depth', str(p.clone_depth))
332 339
@@ -564,12 +571,15 @@ class XmlManifest(object):
564 groups = node.getAttribute('groups') 571 groups = node.getAttribute('groups')
565 if groups: 572 if groups:
566 groups = self._ParseGroups(groups) 573 groups = self._ParseGroups(groups)
574 revision = node.getAttribute('revision')
567 575
568 for p in self._projects[name]: 576 for p in self._projects[name]:
569 if path and p.relpath != path: 577 if path and p.relpath != path:
570 continue 578 continue
571 if groups: 579 if groups:
572 p.groups.extend(groups) 580 p.groups.extend(groups)
581 if revision:
582 p.revisionExpr = revision
573 if node.nodeName == 'repo-hooks': 583 if node.nodeName == 'repo-hooks':
574 # Get the name of the project and the (space-separated) list of enabled. 584 # Get the name of the project and the (space-separated) list of enabled.
575 repo_hooks_project = self._reqatt(node, 'in-project') 585 repo_hooks_project = self._reqatt(node, 'in-project')
@@ -702,6 +712,12 @@ class XmlManifest(object):
702 d.sync_s = False 712 d.sync_s = False
703 else: 713 else:
704 d.sync_s = sync_s.lower() in ("yes", "true", "1") 714 d.sync_s = sync_s.lower() in ("yes", "true", "1")
715
716 sync_tags = node.getAttribute('sync-tags')
717 if not sync_tags:
718 d.sync_tags = True
719 else:
720 d.sync_tags = sync_tags.lower() in ("yes", "true", "1")
705 return d 721 return d
706 722
707 def _ParseNotice(self, node): 723 def _ParseNotice(self, node):
@@ -796,6 +812,12 @@ class XmlManifest(object):
796 else: 812 else:
797 sync_s = sync_s.lower() in ("yes", "true", "1") 813 sync_s = sync_s.lower() in ("yes", "true", "1")
798 814
815 sync_tags = node.getAttribute('sync-tags')
816 if not sync_tags:
817 sync_tags = self._default.sync_tags
818 else:
819 sync_tags = sync_tags.lower() in ("yes", "true", "1")
820
799 clone_depth = node.getAttribute('clone-depth') 821 clone_depth = node.getAttribute('clone-depth')
800 if clone_depth: 822 if clone_depth:
801 try: 823 try:
@@ -841,6 +863,7 @@ class XmlManifest(object):
841 groups = groups, 863 groups = groups,
842 sync_c = sync_c, 864 sync_c = sync_c,
843 sync_s = sync_s, 865 sync_s = sync_s,
866 sync_tags = sync_tags,
844 clone_depth = clone_depth, 867 clone_depth = clone_depth,
845 upstream = upstream, 868 upstream = upstream,
846 parent = parent, 869 parent = parent,