mercurial/cmdutil.py
changeset 37956 f1f8b655da32
parent 37840 853001c84114
child 37957 fb0de0bcd297
equal deleted inserted replaced
37955:d088810c496e 37956:f1f8b655da32
  2995                     ui.warn(msg % rel)
  2995                     ui.warn(msg % rel)
  2996                 break
  2996                 break
  2997 
  2997 
  2998         if not opts.get('dry_run'):
  2998         if not opts.get('dry_run'):
  2999             needdata = ('revert', 'add', 'undelete')
  2999             needdata = ('revert', 'add', 'undelete')
  3000             if _revertprefetch is not _revertprefetchstub:
       
  3001                 ui.deprecwarn("'cmdutil._revertprefetch' is deprecated, "
       
  3002                               "add a callback to 'scmutil.fileprefetchhooks'",
       
  3003                               '4.6', stacklevel=1)
       
  3004                 _revertprefetch(repo, ctx,
       
  3005                                 *[actions[name][0] for name in needdata])
       
  3006             oplist = [actions[name][0] for name in needdata]
  3000             oplist = [actions[name][0] for name in needdata]
  3007             prefetch = scmutil.prefetchfiles
  3001             prefetch = scmutil.prefetchfiles
  3008             matchfiles = scmutil.matchfiles
  3002             matchfiles = scmutil.matchfiles
  3009             prefetch(repo, [ctx.rev()],
  3003             prefetch(repo, [ctx.rev()],
  3010                      matchfiles(repo,
  3004                      matchfiles(repo,
  3018                     wctx.sub(sub).revert(ctx.substate[sub], *pats,
  3012                     wctx.sub(sub).revert(ctx.substate[sub], *pats,
  3019                                          **pycompat.strkwargs(opts))
  3013                                          **pycompat.strkwargs(opts))
  3020                 except KeyError:
  3014                 except KeyError:
  3021                     raise error.Abort("subrepository '%s' does not exist in %s!"
  3015                     raise error.Abort("subrepository '%s' does not exist in %s!"
  3022                                       % (sub, short(ctx.node())))
  3016                                       % (sub, short(ctx.node())))
  3023 
       
  3024 def _revertprefetchstub(repo, ctx, *files):
       
  3025     """Stub method for detecting extension wrapping of _revertprefetch(), to
       
  3026     issue a deprecation warning."""
       
  3027 
       
  3028 _revertprefetch = _revertprefetchstub
       
  3029 
  3017 
  3030 def _performrevert(repo, parents, ctx, actions, interactive=False,
  3018 def _performrevert(repo, parents, ctx, actions, interactive=False,
  3031                    tobackup=None):
  3019                    tobackup=None):
  3032     """function that actually perform all the actions computed for revert
  3020     """function that actually perform all the actions computed for revert
  3033 
  3021