mirror of
https://gerrit.googlesource.com/git-repo
synced 2026-11-26 06:32:19 +00:00
Phased sync orders each fetch batch slowest-first using `.repo_fetchtimes.json`, whereas interleaved sync dispatched each hierarchical level in path order, letting slow projects near the end of a level start late and extend the tail of the sync. Combining fetch and checkout times into `.repo_fetchtimes.json` would mix units with phased mode and older repo versions, and cause `-n` or `-l` runs to either skew full-sync estimates or sort by the wrong phase. Keep fetch and checkout estimates separate instead: - Parameterize `_SyncTimes` by filename and track fetch durations in `.repo_fetchtimes.json` and checkout durations in `.repo_checkouttimes.json`, recording a phase only when it succeeds. - Sort each interleaved level slowest-first by the phases active in `opt` (fetch when not `-l`, checkout when not `-n` and the project has a worktree). - Sort each `_SafeCheckoutOrder` level in phased `_Checkout` by `_checkout_times` and save in `finally` so phased and interleaved runs maintain and use the same per-phase estimates. Bug: 543101585 Change-Id: Ie8b15a95ab2d8019b058d5f839a93501d0d85979 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/657085 Tested-by: Gavin Mak <gavinmak@google.com> Reviewed-by: Brian Gan <brgan@google.com> Commit-Queue: Gavin Mak <gavinmak@google.com>