From 2e6d0881d9df9a61ac7dfa533b727ae9e9b4403e Mon Sep 17 00:00:00 2001 From: Gavin Mak Date: Thu, 17 Jul 2025 13:17:32 -0700 Subject: sync: Improve UI and error reporting for interleaved mode This fixes two issues: 1. the progress bar could show a count greater than the total if new projects were discovered mid-sync. Update the progress bar total dynamically 2. Make "Stall detected" error message more actionable Bug: 432206932 Change-Id: Ie2a4ada5b1770cae0302fb06590641c522cbb7e7 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/491941 Tested-by: Gavin Mak Reviewed-by: Scott Lee Commit-Queue: Gavin Mak --- progress.py | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'progress.py') diff --git a/progress.py b/progress.py index 31a4890a..30ec8c3b 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) -- cgit v1.2.3-54-g00ecf