summaryrefslogtreecommitdiffstats
path: root/progress.py
diff options
context:
space:
mode:
authorGavin Mak <gavinmak@google.com>2025-07-17 13:17:32 -0700
committerLUCI <gerrit-scoped@luci-project-accounts.iam.gserviceaccount.com>2025-07-17 17:30:33 -0700
commit2e6d0881d9df9a61ac7dfa533b727ae9e9b4403e (patch)
tree05b1379e2f5195981be20dd94eb9082bc8350d42 /progress.py
parent74edacd8e54a11c9358421894a5fcce04b02c47d (diff)
downloadgit-repo-2e6d0881d9df9a61ac7dfa533b727ae9e9b4403e.tar.gz
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 <gavinmak@google.com> Reviewed-by: Scott Lee <ddoman@google.com> Commit-Queue: Gavin Mak <gavinmak@google.com>
Diffstat (limited to 'progress.py')
-rw-r--r--progress.py5
1 files changed, 5 insertions, 0 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)