Added config option 'prefetchdays' which indicates that commits older than
'prefetchdays' days should not be prefetched. This option is necessary to avoid
prefetch of huge amount of data. The default value is set to 14 days.
Details
- Reviewers
ryanmce simonfar durham simpkins - Group Reviewers
Restricted Project - Commits
- rFBHGX8e71109eeda8: remotefilelog: limit number of changesets to be prefetched
Ensure that unit tests pass
Diff Detail
- Repository
- rFBHGX Facebook Mercurial Extensions
- Lint
Automatic diff as part of commit; lint not applicable. - Unit
Automatic diff as part of commit; unit tests not applicable.
Event Timeline
The main change looks good, but I have some comments about the test updates.
remotefilelog/__init__.py | ||
---|---|---|
949–953 | Is it worth adding a helper function that updates an input revset with the date | |
tests/test-remotefilelog-bgprefetch.t | ||
34–35 | The style checker doesn't run on the .t files, but I would vote for wrapping | |
39 | Isn't this expression setting prefetchdays to a number of seconds rather than This is probably achieving what you want by asking for all commits in the last Would it be worth updating the code to prefetch all commits if the prefetchdays |
Thanks for the comment. I will make some changes now.
tests/test-remotefilelog-bgprefetch.t | ||
---|---|---|
39 | Ooops, I forgot to divide it by 86400. But I quite liked your idea about setting it to zero and adding a helper function. |
Added a helper function that updates a revset by adding to it date restriction from prefetchdays config.
Is it worth adding a helper function that updates an input revset with the date
restriction from the prefetchdays config? Then you could use it both here
and above.