diff options
| -rw-r--r-- | docs/manifest-format.txt | 6 | ||||
| -rw-r--r-- | manifest_xml.py | 10 |
2 files changed, 14 insertions, 2 deletions
diff --git a/docs/manifest-format.txt b/docs/manifest-format.txt index 56bdf142..0c957dd5 100644 --- a/docs/manifest-format.txt +++ b/docs/manifest-format.txt | |||
| @@ -44,6 +44,7 @@ following DTD: | |||
| 44 | <!ATTLIST default remote IDREF #IMPLIED> | 44 | <!ATTLIST default remote IDREF #IMPLIED> |
| 45 | <!ATTLIST default revision CDATA #IMPLIED> | 45 | <!ATTLIST default revision CDATA #IMPLIED> |
| 46 | <!ATTLIST default dest-branch CDATA #IMPLIED> | 46 | <!ATTLIST default dest-branch CDATA #IMPLIED> |
| 47 | <!ATTLIST default upstream CDATA #IMPLIED> | ||
| 47 | <!ATTLIST default sync-j CDATA #IMPLIED> | 48 | <!ATTLIST default sync-j CDATA #IMPLIED> |
| 48 | <!ATTLIST default sync-c CDATA #IMPLIED> | 49 | <!ATTLIST default sync-c CDATA #IMPLIED> |
| 49 | <!ATTLIST default sync-s CDATA #IMPLIED> | 50 | <!ATTLIST default sync-s CDATA #IMPLIED> |
| @@ -164,6 +165,11 @@ Project elements not setting their own `dest-branch` will inherit | |||
| 164 | this value. If this value is not set, projects will use `revision` | 165 | this value. If this value is not set, projects will use `revision` |
| 165 | by default instead. | 166 | by default instead. |
| 166 | 167 | ||
| 168 | Attribute `upstream`: Name of the Git ref in which a sha1 | ||
| 169 | can be found. Used when syncing a revision locked manifest in | ||
| 170 | -c mode to avoid having to sync the entire ref space. Project elements | ||
| 171 | not setting their own `upstream` will inherit this value. | ||
| 172 | |||
| 167 | Attribute `sync-j`: Number of parallel jobs to use when synching. | 173 | Attribute `sync-j`: Number of parallel jobs to use when synching. |
| 168 | 174 | ||
| 169 | Attribute `sync-c`: Set to true to only sync the given Git | 175 | Attribute `sync-c`: Set to true to only sync the given Git |
diff --git a/manifest_xml.py b/manifest_xml.py index 60d61168..d0211eaf 100644 --- a/manifest_xml.py +++ b/manifest_xml.py | |||
| @@ -59,6 +59,7 @@ class _Default(object): | |||
| 59 | 59 | ||
| 60 | revisionExpr = None | 60 | revisionExpr = None |
| 61 | destBranchExpr = None | 61 | destBranchExpr = None |
| 62 | upstreamExpr = None | ||
| 62 | remote = None | 63 | remote = None |
| 63 | sync_j = 1 | 64 | sync_j = 1 |
| 64 | sync_c = False | 65 | sync_c = False |
| @@ -230,6 +231,9 @@ class XmlManifest(object): | |||
| 230 | if d.destBranchExpr: | 231 | if d.destBranchExpr: |
| 231 | have_default = True | 232 | have_default = True |
| 232 | e.setAttribute('dest-branch', d.destBranchExpr) | 233 | e.setAttribute('dest-branch', d.destBranchExpr) |
| 234 | if d.upstreamExpr: | ||
| 235 | have_default = True | ||
| 236 | e.setAttribute('upstream', d.upstreamExpr) | ||
| 233 | if d.sync_j > 1: | 237 | if d.sync_j > 1: |
| 234 | have_default = True | 238 | have_default = True |
| 235 | e.setAttribute('sync-j', '%d' % d.sync_j) | 239 | e.setAttribute('sync-j', '%d' % d.sync_j) |
| @@ -295,7 +299,8 @@ class XmlManifest(object): | |||
| 295 | revision = self.remotes[p.remote.orig_name].revision or d.revisionExpr | 299 | revision = self.remotes[p.remote.orig_name].revision or d.revisionExpr |
| 296 | if not revision or revision != p.revisionExpr: | 300 | if not revision or revision != p.revisionExpr: |
| 297 | e.setAttribute('revision', p.revisionExpr) | 301 | e.setAttribute('revision', p.revisionExpr) |
| 298 | if p.upstream and p.upstream != p.revisionExpr: | 302 | if (p.upstream and (p.upstream != p.revisionExpr or |
| 303 | p.upstream != d.upstreamExpr)): | ||
| 299 | e.setAttribute('upstream', p.upstream) | 304 | e.setAttribute('upstream', p.upstream) |
| 300 | 305 | ||
| 301 | if p.dest_branch and p.dest_branch != d.destBranchExpr: | 306 | if p.dest_branch and p.dest_branch != d.destBranchExpr: |
| @@ -694,6 +699,7 @@ class XmlManifest(object): | |||
| 694 | d.revisionExpr = None | 699 | d.revisionExpr = None |
| 695 | 700 | ||
| 696 | d.destBranchExpr = node.getAttribute('dest-branch') or None | 701 | d.destBranchExpr = node.getAttribute('dest-branch') or None |
| 702 | d.upstreamExpr = node.getAttribute('upstream') or None | ||
| 697 | 703 | ||
| 698 | sync_j = node.getAttribute('sync-j') | 704 | sync_j = node.getAttribute('sync-j') |
| 699 | if sync_j == '' or sync_j is None: | 705 | if sync_j == '' or sync_j is None: |
| @@ -830,7 +836,7 @@ class XmlManifest(object): | |||
| 830 | 836 | ||
| 831 | dest_branch = node.getAttribute('dest-branch') or self._default.destBranchExpr | 837 | dest_branch = node.getAttribute('dest-branch') or self._default.destBranchExpr |
| 832 | 838 | ||
| 833 | upstream = node.getAttribute('upstream') | 839 | upstream = node.getAttribute('upstream') or self._default.upstreamExpr |
| 834 | 840 | ||
| 835 | groups = '' | 841 | groups = '' |
| 836 | if node.hasAttribute('groups'): | 842 | if node.hasAttribute('groups'): |
