summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--docs/manifest-format.txt10
-rw-r--r--git_config.py7
-rw-r--r--manifest_xml.py23
-rw-r--r--project.py8
4 files changed, 46 insertions, 2 deletions
diff --git a/docs/manifest-format.txt b/docs/manifest-format.txt
index 77784099..56bdf142 100644
--- a/docs/manifest-format.txt
+++ b/docs/manifest-format.txt
@@ -47,6 +47,7 @@ following DTD:
47 <!ATTLIST default sync-j CDATA #IMPLIED> 47 <!ATTLIST default sync-j CDATA #IMPLIED>
48 <!ATTLIST default sync-c CDATA #IMPLIED> 48 <!ATTLIST default sync-c CDATA #IMPLIED>
49 <!ATTLIST default sync-s CDATA #IMPLIED> 49 <!ATTLIST default sync-s CDATA #IMPLIED>
50 <!ATTLIST default sync-tags CDATA #IMPLIED>
50 51
51 <!ELEMENT manifest-server EMPTY> 52 <!ELEMENT manifest-server EMPTY>
52 <!ATTLIST manifest-server url CDATA #REQUIRED> 53 <!ATTLIST manifest-server url CDATA #REQUIRED>
@@ -63,6 +64,7 @@ following DTD:
63 <!ATTLIST project groups CDATA #IMPLIED> 64 <!ATTLIST project groups CDATA #IMPLIED>
64 <!ATTLIST project sync-c CDATA #IMPLIED> 65 <!ATTLIST project sync-c CDATA #IMPLIED>
65 <!ATTLIST project sync-s CDATA #IMPLIED> 66 <!ATTLIST project sync-s CDATA #IMPLIED>
67 <!ATTLIST default sync-tags CDATA #IMPLIED>
66 <!ATTLIST project upstream CDATA #IMPLIED> 68 <!ATTLIST project upstream CDATA #IMPLIED>
67 <!ATTLIST project clone-depth CDATA #IMPLIED> 69 <!ATTLIST project clone-depth CDATA #IMPLIED>
68 <!ATTLIST project force-path CDATA #IMPLIED> 70 <!ATTLIST project force-path CDATA #IMPLIED>
@@ -84,6 +86,7 @@ following DTD:
84 <!ATTLIST extend-project name CDATA #REQUIRED> 86 <!ATTLIST extend-project name CDATA #REQUIRED>
85 <!ATTLIST extend-project path CDATA #IMPLIED> 87 <!ATTLIST extend-project path CDATA #IMPLIED>
86 <!ATTLIST extend-project groups CDATA #IMPLIED> 88 <!ATTLIST extend-project groups CDATA #IMPLIED>
89 <!ATTLIST extend-project revision CDATA #IMPLIED>
87 90
88 <!ELEMENT remove-project EMPTY> 91 <!ELEMENT remove-project EMPTY>
89 <!ATTLIST remove-project name CDATA #REQUIRED> 92 <!ATTLIST remove-project name CDATA #REQUIRED>
@@ -170,6 +173,10 @@ their own will use this value.
170 173
171Attribute `sync-s`: Set to true to also sync sub-projects. 174Attribute `sync-s`: Set to true to also sync sub-projects.
172 175
176Attribute `sync-tags`: Set to false to only sync the given Git
177branch (specified in the `revision` attribute) rather than
178the other ref tags.
179
173 180
174Element manifest-server 181Element manifest-server
175----------------------- 182-----------------------
@@ -294,6 +301,9 @@ at the specified path, rather than all projects with the given name.
294Attribute `groups`: List of additional groups to which this project 301Attribute `groups`: List of additional groups to which this project
295belongs. Same syntax as the corresponding element of `project`. 302belongs. Same syntax as the corresponding element of `project`.
296 303
304Attribute `revision`: If specified, overrides the revision of the original
305project. Same syntax as the corresponding element of `project`.
306
297Element annotation 307Element annotation
298------------------ 308------------------
299 309
diff --git a/git_config.py b/git_config.py
index 3ba9dbd1..854b2387 100644
--- a/git_config.py
+++ b/git_config.py
@@ -534,7 +534,7 @@ def GetUrlCookieFile(url, quiet):
534 for line in p.stdout: 534 for line in p.stdout:
535 line = line.strip() 535 line = line.strip()
536 if line.startswith(cookieprefix): 536 if line.startswith(cookieprefix):
537 cookiefile = line[len(cookieprefix):] 537 cookiefile = os.path.expanduser(line[len(cookieprefix):])
538 if line.startswith(proxyprefix): 538 if line.startswith(proxyprefix):
539 proxy = line[len(proxyprefix):] 539 proxy = line[len(proxyprefix):]
540 # Leave subprocess open, as cookie file may be transient. 540 # Leave subprocess open, as cookie file may be transient.
@@ -553,7 +553,10 @@ def GetUrlCookieFile(url, quiet):
553 if e.errno == errno.ENOENT: 553 if e.errno == errno.ENOENT:
554 pass # No persistent proxy. 554 pass # No persistent proxy.
555 raise 555 raise
556 yield GitConfig.ForUser().GetString('http.cookiefile'), None 556 cookiefile = GitConfig.ForUser().GetString('http.cookiefile')
557 if cookiefile:
558 cookiefile = os.path.expanduser(cookiefile)
559 yield cookiefile, None
557 560
558def _preconnect(url): 561def _preconnect(url):
559 m = URI_ALL.match(url) 562 m = URI_ALL.match(url)
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,
diff --git a/project.py b/project.py
index 3ba8a073..e4682e6a 100644
--- a/project.py
+++ b/project.py
@@ -660,6 +660,7 @@ class Project(object):
660 groups=None, 660 groups=None,
661 sync_c=False, 661 sync_c=False,
662 sync_s=False, 662 sync_s=False,
663 sync_tags=True,
663 clone_depth=None, 664 clone_depth=None,
664 upstream=None, 665 upstream=None,
665 parent=None, 666 parent=None,
@@ -683,6 +684,7 @@ class Project(object):
683 groups: The `groups` attribute of manifest.xml's project element. 684 groups: The `groups` attribute of manifest.xml's project element.
684 sync_c: The `sync-c` attribute of manifest.xml's project element. 685 sync_c: The `sync-c` attribute of manifest.xml's project element.
685 sync_s: The `sync-s` attribute of manifest.xml's project element. 686 sync_s: The `sync-s` attribute of manifest.xml's project element.
687 sync_tags: The `sync-tags` attribute of manifest.xml's project element.
686 upstream: The `upstream` attribute of manifest.xml's project element. 688 upstream: The `upstream` attribute of manifest.xml's project element.
687 parent: The parent Project object. 689 parent: The parent Project object.
688 is_derived: False if the project was explicitly defined in the manifest; 690 is_derived: False if the project was explicitly defined in the manifest;
@@ -715,6 +717,7 @@ class Project(object):
715 self.groups = groups 717 self.groups = groups
716 self.sync_c = sync_c 718 self.sync_c = sync_c
717 self.sync_s = sync_s 719 self.sync_s = sync_s
720 self.sync_tags = sync_tags
718 self.clone_depth = clone_depth 721 self.clone_depth = clone_depth
719 self.upstream = upstream 722 self.upstream = upstream
720 self.parent = parent 723 self.parent = parent
@@ -1290,6 +1293,10 @@ class Project(object):
1290 elif self.manifest.default.sync_c: 1293 elif self.manifest.default.sync_c:
1291 current_branch_only = True 1294 current_branch_only = True
1292 1295
1296 if not no_tags:
1297 if not self.sync_tags:
1298 no_tags = True
1299
1293 if self.clone_depth: 1300 if self.clone_depth:
1294 depth = self.clone_depth 1301 depth = self.clone_depth
1295 else: 1302 else:
@@ -1901,6 +1908,7 @@ class Project(object):
1901 groups=self.groups, 1908 groups=self.groups,
1902 sync_c=self.sync_c, 1909 sync_c=self.sync_c,
1903 sync_s=self.sync_s, 1910 sync_s=self.sync_s,
1911 sync_tags=self.sync_tags,
1904 parent=self, 1912 parent=self,
1905 is_derived=True) 1913 is_derived=True)
1906 result.append(subproject) 1914 result.append(subproject)