2869 "add a callback to 'scmutil.fileprefetchhooks'", |
2869 "add a callback to 'scmutil.fileprefetchhooks'", |
2870 '4.6', stacklevel=1) |
2870 '4.6', stacklevel=1) |
2871 _revertprefetch(repo, ctx, |
2871 _revertprefetch(repo, ctx, |
2872 *[actions[name][0] for name in needdata]) |
2872 *[actions[name][0] for name in needdata]) |
2873 oplist = [actions[name][0] for name in needdata] |
2873 oplist = [actions[name][0] for name in needdata] |
2874 _prefetchfiles(repo, ctx, |
2874 prefetch = scmutil.fileprefetchhooks |
2875 [f for sublist in oplist for f in sublist]) |
2875 prefetch(repo, ctx, [f for sublist in oplist for f in sublist]) |
2876 _performrevert(repo, parents, ctx, actions, interactive, tobackup) |
2876 _performrevert(repo, parents, ctx, actions, interactive, tobackup) |
2877 |
2877 |
2878 if targetsubs: |
2878 if targetsubs: |
2879 # Revert the subrepos on the revert list |
2879 # Revert the subrepos on the revert list |
2880 for sub in targetsubs: |
2880 for sub in targetsubs: |
2888 def _revertprefetchstub(repo, ctx, *files): |
2888 def _revertprefetchstub(repo, ctx, *files): |
2889 """Stub method for detecting extension wrapping of _revertprefetch(), to |
2889 """Stub method for detecting extension wrapping of _revertprefetch(), to |
2890 issue a deprecation warning.""" |
2890 issue a deprecation warning.""" |
2891 |
2891 |
2892 _revertprefetch = _revertprefetchstub |
2892 _revertprefetch = _revertprefetchstub |
2893 |
|
2894 def _prefetchfiles(repo, ctx, files): |
|
2895 """Let extensions changing the storage layer prefetch content for any non |
|
2896 merge based command.""" |
|
2897 scmutil.fileprefetchhooks(repo, ctx, files) |
|
2898 |
2893 |
2899 def _performrevert(repo, parents, ctx, actions, interactive=False, |
2894 def _performrevert(repo, parents, ctx, actions, interactive=False, |
2900 tobackup=None): |
2895 tobackup=None): |
2901 """function that actually perform all the actions computed for revert |
2896 """function that actually perform all the actions computed for revert |
2902 |
2897 |