diff --git a/progress.py b/progress.py index 31a4890a6..30ec8c3b6 100644 --- a/progress.py +++ b/progress.py @@ -119,6 +119,11 @@ class Progress: if not quiet and show_elapsed: self._update_thread.start() + def update_total(self, new_total): + """Updates the total if the new total is larger.""" + if new_total > self._total: + self._total = new_total + def _update_loop(self): while True: self.update(inc=0) diff --git a/subcmds/sync.py b/subcmds/sync.py index 250925f49..95a7b36f9 100644 --- a/subcmds/sync.py +++ b/subcmds/sync.py @@ -2505,12 +2505,20 @@ later is required to fix a server side protocol bug. pending_relpaths = {p.relpath for p in projects_to_sync} if previously_pending_relpaths == pending_relpaths: - logger.error( - "Stall detected in interleaved sync, not all " - "projects could be synced." + stalled_projects_str = "\n".join( + f" - {path}" + for path in sorted(list(pending_relpaths)) ) - err_event.set() - break + logger.error( + "The following projects failed and could not " + "be synced:\n%s", + stalled_projects_str, + ) + # Include these in the final error report. + self._interleaved_err_checkout = True + self._interleaved_err_checkout_results.extend( + list(pending_relpaths) + ) previously_pending_relpaths = pending_relpaths self.get_parallel_context()[ @@ -2570,6 +2578,7 @@ later is required to fix a server side protocol bug. manifest=manifest, all_manifests=not opt.this_manifest_only, ) + pm.update_total(len(project_list)) finally: sync_event.set() sync_progress_thread.join()