diff options
Diffstat (limited to 'manifest_xml.py')
| -rw-r--r-- | manifest_xml.py | 29 |
1 files changed, 23 insertions, 6 deletions
diff --git a/manifest_xml.py b/manifest_xml.py index 9c882af6..9b5d7847 100644 --- a/manifest_xml.py +++ b/manifest_xml.py | |||
| @@ -32,6 +32,7 @@ else: | |||
| 32 | import gitc_utils | 32 | import gitc_utils |
| 33 | from git_config import GitConfig | 33 | from git_config import GitConfig |
| 34 | from git_refs import R_HEADS, HEAD | 34 | from git_refs import R_HEADS, HEAD |
| 35 | import platform_utils | ||
| 35 | from project import RemoteSpec, Project, MetaProject | 36 | from project import RemoteSpec, Project, MetaProject |
| 36 | from error import ManifestParseError, ManifestInvalidRevisionError | 37 | from error import ManifestParseError, ManifestInvalidRevisionError |
| 37 | 38 | ||
| @@ -40,8 +41,18 @@ LOCAL_MANIFEST_NAME = 'local_manifest.xml' | |||
| 40 | LOCAL_MANIFESTS_DIR_NAME = 'local_manifests' | 41 | LOCAL_MANIFESTS_DIR_NAME = 'local_manifests' |
| 41 | 42 | ||
| 42 | # urljoin gets confused if the scheme is not known. | 43 | # urljoin gets confused if the scheme is not known. |
| 43 | urllib.parse.uses_relative.extend(['ssh', 'git', 'persistent-https', 'rpc']) | 44 | urllib.parse.uses_relative.extend([ |
| 44 | urllib.parse.uses_netloc.extend(['ssh', 'git', 'persistent-https', 'rpc']) | 45 | 'ssh', |
| 46 | 'git', | ||
| 47 | 'persistent-https', | ||
| 48 | 'sso', | ||
| 49 | 'rpc']) | ||
| 50 | urllib.parse.uses_netloc.extend([ | ||
| 51 | 'ssh', | ||
| 52 | 'git', | ||
| 53 | 'persistent-https', | ||
| 54 | 'sso', | ||
| 55 | 'rpc']) | ||
| 45 | 56 | ||
| 46 | class _Default(object): | 57 | class _Default(object): |
| 47 | """Project defaults within the manifest.""" | 58 | """Project defaults within the manifest.""" |
| @@ -100,7 +111,8 @@ class _XmlRemote(object): | |||
| 100 | return url | 111 | return url |
| 101 | 112 | ||
| 102 | def ToRemoteSpec(self, projectName): | 113 | def ToRemoteSpec(self, projectName): |
| 103 | url = self.resolvedFetchUrl.rstrip('/') + '/' + projectName | 114 | fetchUrl = self.resolvedFetchUrl.rstrip('/') |
| 115 | url = fetchUrl + '/' + projectName | ||
| 104 | remoteName = self.name | 116 | remoteName = self.name |
| 105 | if self.remoteAlias: | 117 | if self.remoteAlias: |
| 106 | remoteName = self.remoteAlias | 118 | remoteName = self.remoteAlias |
| @@ -108,7 +120,8 @@ class _XmlRemote(object): | |||
| 108 | url=url, | 120 | url=url, |
| 109 | pushUrl=self.pushUrl, | 121 | pushUrl=self.pushUrl, |
| 110 | review=self.reviewUrl, | 122 | review=self.reviewUrl, |
| 111 | orig_name=self.name) | 123 | orig_name=self.name, |
| 124 | fetchUrl=self.fetchUrl) | ||
| 112 | 125 | ||
| 113 | class XmlManifest(object): | 126 | class XmlManifest(object): |
| 114 | """manages the repo configuration file""" | 127 | """manages the repo configuration file""" |
| @@ -153,8 +166,8 @@ class XmlManifest(object): | |||
| 153 | 166 | ||
| 154 | try: | 167 | try: |
| 155 | if os.path.lexists(self.manifestFile): | 168 | if os.path.lexists(self.manifestFile): |
| 156 | os.remove(self.manifestFile) | 169 | platform_utils.remove(self.manifestFile) |
| 157 | os.symlink('manifests/%s' % name, self.manifestFile) | 170 | platform_utils.symlink(os.path.join('manifests', name), self.manifestFile) |
| 158 | except OSError as e: | 171 | except OSError as e: |
| 159 | raise ManifestParseError('cannot link manifest %s: %s' % (name, str(e))) | 172 | raise ManifestParseError('cannot link manifest %s: %s' % (name, str(e))) |
| 160 | 173 | ||
| @@ -383,6 +396,10 @@ class XmlManifest(object): | |||
| 383 | def IsArchive(self): | 396 | def IsArchive(self): |
| 384 | return self.manifestProject.config.GetBoolean('repo.archive') | 397 | return self.manifestProject.config.GetBoolean('repo.archive') |
| 385 | 398 | ||
| 399 | @property | ||
| 400 | def HasSubmodules(self): | ||
| 401 | return self.manifestProject.config.GetBoolean('repo.submodules') | ||
| 402 | |||
| 386 | def _Unload(self): | 403 | def _Unload(self): |
| 387 | self._loaded = False | 404 | self._loaded = False |
| 388 | self._projects = {} | 405 | self._projects = {} |
