diff options
-rw-r--r-- | subcmds/sync.py | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/subcmds/sync.py b/subcmds/sync.py index 0e4f34c0..224d9885 100644 --- a/subcmds/sync.py +++ b/subcmds/sync.py | |||
@@ -679,16 +679,20 @@ later is required to fix a server side protocol bug. | |||
679 | def _GetSyncProgressMessage(self): | 679 | def _GetSyncProgressMessage(self): |
680 | earliest_time = float("inf") | 680 | earliest_time = float("inf") |
681 | earliest_proj = None | 681 | earliest_proj = None |
682 | for project, t in self._sync_dict.items(): | 682 | items = self._sync_dict.items() |
683 | for project, t in items: | ||
683 | if t < earliest_time: | 684 | if t < earliest_time: |
684 | earliest_time = t | 685 | earliest_time = t |
685 | earliest_proj = project | 686 | earliest_proj = project |
686 | 687 | ||
687 | if not earliest_proj: | 688 | if not earliest_proj: |
688 | return None | 689 | # This function is called when sync is still running but in some |
690 | # cases (by chance), _sync_dict can contain no entries. Return some | ||
691 | # text to indicate that sync is still working. | ||
692 | return "..working.." | ||
689 | 693 | ||
690 | elapsed = time.time() - earliest_time | 694 | elapsed = time.time() - earliest_time |
691 | jobs = jobs_str(len(self._sync_dict)) | 695 | jobs = jobs_str(len(items)) |
692 | return f"{jobs} | {elapsed_str(elapsed)} {earliest_proj}" | 696 | return f"{jobs} | {elapsed_str(elapsed)} {earliest_proj}" |
693 | 697 | ||
694 | def _Fetch(self, projects, opt, err_event, ssh_proxy): | 698 | def _Fetch(self, projects, opt, err_event, ssh_proxy): |