diff options
Diffstat (limited to 'subcmds')
| -rw-r--r-- | subcmds/init.py | 8 | ||||
| -rw-r--r-- | subcmds/sync.py | 18 |
2 files changed, 17 insertions, 9 deletions
diff --git a/subcmds/init.py b/subcmds/init.py index 750facba..536e367c 100644 --- a/subcmds/init.py +++ b/subcmds/init.py | |||
| @@ -12,7 +12,6 @@ | |||
| 12 | # See the License for the specific language governing permissions and | 12 | # See the License for the specific language governing permissions and |
| 13 | # limitations under the License. | 13 | # limitations under the License. |
| 14 | 14 | ||
| 15 | import optparse | ||
| 16 | import os | 15 | import os |
| 17 | import platform | 16 | import platform |
| 18 | import re | 17 | import re |
| @@ -97,10 +96,13 @@ to update the working directory files. | |||
| 97 | """ | 96 | """ |
| 98 | superproject = git_superproject.Superproject(self.manifest, | 97 | superproject = git_superproject.Superproject(self.manifest, |
| 99 | self.repodir, | 98 | self.repodir, |
| 99 | self.git_event_log, | ||
| 100 | quiet=opt.quiet) | 100 | quiet=opt.quiet) |
| 101 | if not superproject.Sync(): | 101 | sync_result = superproject.Sync() |
| 102 | if not sync_result.success: | ||
| 102 | print('error: git update of superproject failed', file=sys.stderr) | 103 | print('error: git update of superproject failed', file=sys.stderr) |
| 103 | sys.exit(1) | 104 | if sync_result.fatal: |
| 105 | sys.exit(1) | ||
| 104 | 106 | ||
| 105 | def _SyncManifest(self, opt): | 107 | def _SyncManifest(self, opt): |
| 106 | m = self.manifest.manifestProject | 108 | m = self.manifest.manifestProject |
diff --git a/subcmds/sync.py b/subcmds/sync.py index b15d9477..8d89cf72 100644 --- a/subcmds/sync.py +++ b/subcmds/sync.py | |||
| @@ -302,21 +302,25 @@ later is required to fix a server side protocol bug. | |||
| 302 | load_local_manifests: Whether to load local manifests. | 302 | load_local_manifests: Whether to load local manifests. |
| 303 | 303 | ||
| 304 | Returns: | 304 | Returns: |
| 305 | Returns path to the overriding manifest file. | 305 | Returns path to the overriding manifest file instead of None. |
| 306 | """ | 306 | """ |
| 307 | superproject = git_superproject.Superproject(self.manifest, | 307 | superproject = git_superproject.Superproject(self.manifest, |
| 308 | self.repodir, | 308 | self.repodir, |
| 309 | self.git_event_log, | ||
| 309 | quiet=opt.quiet) | 310 | quiet=opt.quiet) |
| 310 | all_projects = self.GetProjects(args, | 311 | all_projects = self.GetProjects(args, |
| 311 | missing_ok=True, | 312 | missing_ok=True, |
| 312 | submodules_ok=opt.fetch_submodules) | 313 | submodules_ok=opt.fetch_submodules) |
| 313 | manifest_path = superproject.UpdateProjectsRevisionId(all_projects) | 314 | update_result = superproject.UpdateProjectsRevisionId(all_projects) |
| 314 | if not manifest_path: | 315 | manifest_path = update_result.manifest_path |
| 316 | if manifest_path: | ||
| 317 | self._ReloadManifest(manifest_path, load_local_manifests) | ||
| 318 | else: | ||
| 315 | print('error: Update of revsionId from superproject has failed. ' | 319 | print('error: Update of revsionId from superproject has failed. ' |
| 316 | 'Please resync with --no-use-superproject option', | 320 | 'Please resync with --no-use-superproject option', |
| 317 | file=sys.stderr) | 321 | file=sys.stderr) |
| 318 | sys.exit(1) | 322 | if update_result.fatal: |
| 319 | self._ReloadManifest(manifest_path, load_local_manifests) | 323 | sys.exit(1) |
| 320 | return manifest_path | 324 | return manifest_path |
| 321 | 325 | ||
| 322 | def _FetchProjectList(self, opt, projects): | 326 | def _FetchProjectList(self, opt, projects): |
| @@ -961,7 +965,9 @@ later is required to fix a server side protocol bug. | |||
| 961 | 965 | ||
| 962 | load_local_manifests = not self.manifest.HasLocalManifests | 966 | load_local_manifests = not self.manifest.HasLocalManifests |
| 963 | if self._UseSuperproject(opt): | 967 | if self._UseSuperproject(opt): |
| 964 | manifest_name = self._UpdateProjectsRevisionId(opt, args, load_local_manifests) | 968 | new_manifest_name = self._UpdateProjectsRevisionId(opt, args, load_local_manifests) |
| 969 | if not new_manifest_name: | ||
| 970 | manifest_name = new_manifest_name | ||
| 965 | 971 | ||
| 966 | if self.gitc_manifest: | 972 | if self.gitc_manifest: |
| 967 | gitc_manifest_projects = self.GetProjects(args, | 973 | gitc_manifest_projects = self.GetProjects(args, |
