mercurial/commands.py
changeset 50847 6720894996f2
parent 50846 1d9ba5b40093
child 50848 eb23eada6550
equal deleted inserted replaced
50846:1d9ba5b40093 50847:6720894996f2
  6030 
  6030 
  6031     This command takes effect with the next commit by default.
  6031     This command takes effect with the next commit by default.
  6032 
  6032 
  6033     Returns 0 on success, 1 if errors are encountered.
  6033     Returns 0 on success, 1 if errors are encountered.
  6034     """
  6034     """
  6035     opts = pycompat.byteskwargs(opts)
       
  6036     context = lambda repo: repo.dirstate.changing_files(repo)
  6035     context = lambda repo: repo.dirstate.changing_files(repo)
  6037     rev = opts.get(b'at_rev')
  6036     rev = opts.get('at_rev')
  6038     ctx = None
  6037     ctx = None
  6039     if rev:
  6038     if rev:
  6040         ctx = logcmdutil.revsingle(repo, rev)
  6039         ctx = logcmdutil.revsingle(repo, rev)
  6041         if ctx.rev() is not None:
  6040         if ctx.rev() is not None:
  6042 
  6041 
  6043             def context(repo):
  6042             def context(repo):
  6044                 return util.nullcontextmanager()
  6043                 return util.nullcontextmanager()
  6045 
  6044 
  6046             opts[b'at_rev'] = ctx.rev()
  6045             opts['at_rev'] = ctx.rev()
  6047     with repo.wlock(), context(repo):
  6046     with repo.wlock(), context(repo):
  6048         return cmdutil.copy(ui, repo, pats, opts, rename=True)
  6047         return cmdutil.copy(
       
  6048             ui, repo, pats, pycompat.byteskwargs(opts), rename=True
       
  6049         )
  6049 
  6050 
  6050 
  6051 
  6051 @command(
  6052 @command(
  6052     b'resolve',
  6053     b'resolve',
  6053     [
  6054     [