summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--progress.py5
-rw-r--r--subcmds/sync.py16
2 files changed, 19 insertions, 2 deletions
diff --git a/progress.py b/progress.py
index 31a4890a..30ec8c3b 100644
--- a/progress.py
+++ b/progress.py
@@ -119,6 +119,11 @@ class Progress:
119 if not quiet and show_elapsed: 119 if not quiet and show_elapsed:
120 self._update_thread.start() 120 self._update_thread.start()
121 121
122 def update_total(self, new_total):
123 """Updates the total if the new total is larger."""
124 if new_total > self._total:
125 self._total = new_total
126
122 def _update_loop(self): 127 def _update_loop(self):
123 while True: 128 while True:
124 self.update(inc=0) 129 self.update(inc=0)
diff --git a/subcmds/sync.py b/subcmds/sync.py
index 250925f4..13a322bc 100644
--- a/subcmds/sync.py
+++ b/subcmds/sync.py
@@ -2505,11 +2505,22 @@ later is required to fix a server side protocol bug.
2505 2505
2506 pending_relpaths = {p.relpath for p in projects_to_sync} 2506 pending_relpaths = {p.relpath for p in projects_to_sync}
2507 if previously_pending_relpaths == pending_relpaths: 2507 if previously_pending_relpaths == pending_relpaths:
2508 stalled_projects_str = "\n".join(
2509 f" - {path}"
2510 for path in sorted(list(pending_relpaths))
2511 )
2508 logger.error( 2512 logger.error(
2509 "Stall detected in interleaved sync, not all " 2513 "The following projects failed and could not "
2510 "projects could be synced." 2514 "be synced:\n%s",
2515 stalled_projects_str,
2511 ) 2516 )
2512 err_event.set() 2517 err_event.set()
2518
2519 # Include these in the final error report.
2520 self._interleaved_err_checkout = True
2521 self._interleaved_err_checkout_results.extend(
2522 list(pending_relpaths)
2523 )
2513 break 2524 break
2514 previously_pending_relpaths = pending_relpaths 2525 previously_pending_relpaths = pending_relpaths
2515 2526
@@ -2570,6 +2581,7 @@ later is required to fix a server side protocol bug.
2570 manifest=manifest, 2581 manifest=manifest,
2571 all_manifests=not opt.this_manifest_only, 2582 all_manifests=not opt.this_manifest_only,
2572 ) 2583 )
2584 pm.update_total(len(project_list))
2573 finally: 2585 finally:
2574 sync_event.set() 2586 sync_event.set()
2575 sync_progress_thread.join() 2587 sync_progress_thread.join()