summaryrefslogtreecommitdiffstats
path: root/subcmds/sync.py
diff options
context:
space:
mode:
Diffstat (limited to 'subcmds/sync.py')
-rw-r--r--subcmds/sync.py23
1 files changed, 20 insertions, 3 deletions
diff --git a/subcmds/sync.py b/subcmds/sync.py
index 74617544..ed656b8c 100644
--- a/subcmds/sync.py
+++ b/subcmds/sync.py
@@ -282,7 +282,7 @@ later is required to fix a server side protocol bug.
282 """Returns True if current-branch or use-superproject options are enabled.""" 282 """Returns True if current-branch or use-superproject options are enabled."""
283 return opt.current_branch_only or git_superproject.UseSuperproject(opt, self.manifest) 283 return opt.current_branch_only or git_superproject.UseSuperproject(opt, self.manifest)
284 284
285 def _UpdateProjectsRevisionId(self, opt, args, load_local_manifests): 285 def _UpdateProjectsRevisionId(self, opt, args, load_local_manifests, superproject_logging_data):
286 """Update revisionId of every project with the SHA from superproject. 286 """Update revisionId of every project with the SHA from superproject.
287 287
288 This function updates each project's revisionId with SHA from superproject. 288 This function updates each project's revisionId with SHA from superproject.
@@ -293,6 +293,7 @@ later is required to fix a server side protocol bug.
293 args: Arguments to pass to GetProjects. See the GetProjects 293 args: Arguments to pass to GetProjects. See the GetProjects
294 docstring for details. 294 docstring for details.
295 load_local_manifests: Whether to load local manifests. 295 load_local_manifests: Whether to load local manifests.
296 superproject_logging_data: A dictionary of superproject data that is to be logged.
296 297
297 Returns: 298 Returns:
298 Returns path to the overriding manifest file instead of None. 299 Returns path to the overriding manifest file instead of None.
@@ -312,6 +313,7 @@ later is required to fix a server side protocol bug.
312 submodules_ok=opt.fetch_submodules) 313 submodules_ok=opt.fetch_submodules)
313 update_result = superproject.UpdateProjectsRevisionId(all_projects) 314 update_result = superproject.UpdateProjectsRevisionId(all_projects)
314 manifest_path = update_result.manifest_path 315 manifest_path = update_result.manifest_path
316 superproject_logging_data['updatedrevisionid'] = bool(manifest_path)
315 if manifest_path: 317 if manifest_path:
316 self._ReloadManifest(manifest_path, load_local_manifests) 318 self._ReloadManifest(manifest_path, load_local_manifests)
317 else: 319 else:
@@ -964,8 +966,14 @@ later is required to fix a server side protocol bug.
964 self._UpdateManifestProject(opt, mp, manifest_name) 966 self._UpdateManifestProject(opt, mp, manifest_name)
965 967
966 load_local_manifests = not self.manifest.HasLocalManifests 968 load_local_manifests = not self.manifest.HasLocalManifests
967 if git_superproject.UseSuperproject(opt, self.manifest): 969 use_superproject = git_superproject.UseSuperproject(opt, self.manifest)
968 manifest_name = self._UpdateProjectsRevisionId(opt, args, load_local_manifests) or opt.manifest_name 970 superproject_logging_data = {
971 'superproject': use_superproject,
972 'haslocalmanifests': bool(self.manifest.HasLocalManifests),
973 }
974 if use_superproject:
975 manifest_name = self._UpdateProjectsRevisionId(
976 opt, args, load_local_manifests, superproject_logging_data) or opt.manifest_name
969 977
970 if self.gitc_manifest: 978 if self.gitc_manifest:
971 gitc_manifest_projects = self.GetProjects(args, 979 gitc_manifest_projects = self.GetProjects(args,
@@ -1079,6 +1087,15 @@ later is required to fix a server side protocol bug.
1079 file=sys.stderr) 1087 file=sys.stderr)
1080 sys.exit(1) 1088 sys.exit(1)
1081 1089
1090 # Log the previous sync analysis state from the config.
1091 self.git_event_log.LogConfigEvents(mp.config.GetSyncAnalysisStateData(),
1092 'previous_sync_state')
1093
1094 # Update and log with the new sync analysis state.
1095 mp.config.UpdateSyncAnalysisState(opt, superproject_logging_data)
1096 self.git_event_log.LogConfigEvents(mp.config.GetSyncAnalysisStateData(),
1097 'current_sync_state')
1098
1082 if not opt.quiet: 1099 if not opt.quiet:
1083 print('repo sync has finished successfully.') 1100 print('repo sync has finished successfully.')
1084 1101