2860 ui.warn(msg % rel) |
2860 ui.warn(msg % rel) |
2861 break |
2861 break |
2862 |
2862 |
2863 if not opts.get('dry_run'): |
2863 if not opts.get('dry_run'): |
2864 needdata = ('revert', 'add', 'undelete') |
2864 needdata = ('revert', 'add', 'undelete') |
2865 _revertprefetch(repo, ctx, *[actions[name][0] for name in needdata]) |
2865 if _revertprefetch is not _revertprefetchstub: |
|
2866 ui.deprecwarn("'cmdutil._revertprefetch' is deprecated, use " |
|
2867 "'cmdutil._prefetchfiles'", '4.6', stacklevel=1) |
|
2868 _revertprefetch(repo, ctx, |
|
2869 *[actions[name][0] for name in needdata]) |
|
2870 oplist = [actions[name][0] for name in needdata] |
|
2871 _prefetchfiles(repo, ctx, |
|
2872 [f for sublist in oplist for f in sublist]) |
2866 _performrevert(repo, parents, ctx, actions, interactive, tobackup) |
2873 _performrevert(repo, parents, ctx, actions, interactive, tobackup) |
2867 |
2874 |
2868 if targetsubs: |
2875 if targetsubs: |
2869 # Revert the subrepos on the revert list |
2876 # Revert the subrepos on the revert list |
2870 for sub in targetsubs: |
2877 for sub in targetsubs: |
2873 **pycompat.strkwargs(opts)) |
2880 **pycompat.strkwargs(opts)) |
2874 except KeyError: |
2881 except KeyError: |
2875 raise error.Abort("subrepository '%s' does not exist in %s!" |
2882 raise error.Abort("subrepository '%s' does not exist in %s!" |
2876 % (sub, short(ctx.node()))) |
2883 % (sub, short(ctx.node()))) |
2877 |
2884 |
2878 def _revertprefetch(repo, ctx, *files): |
2885 def _revertprefetchstub(repo, ctx, *files): |
2879 """Let extension changing the storage layer prefetch content""" |
2886 """Stub method for detecting extension wrapping of _revertprefetch(), to |
|
2887 issue a deprecation warning.""" |
|
2888 |
|
2889 _revertprefetch = _revertprefetchstub |
|
2890 |
|
2891 def _prefetchfiles(repo, ctx, files): |
|
2892 """Let extensions changing the storage layer prefetch content for any non |
|
2893 merge based command.""" |
2880 |
2894 |
2881 def _performrevert(repo, parents, ctx, actions, interactive=False, |
2895 def _performrevert(repo, parents, ctx, actions, interactive=False, |
2882 tobackup=None): |
2896 tobackup=None): |
2883 """function that actually perform all the actions computed for revert |
2897 """function that actually perform all the actions computed for revert |
2884 |
2898 |