mercurial/cmdutil.py
changeset 35147 3da4bd50103d
parent 35123 7a58608281dd
child 35163 ee64e677c3cf
equal deleted inserted replaced
35146:0b5716ec8500 35147:3da4bd50103d
  3443 
  3443 
  3444 def postcommitstatus(repo, pats, opts):
  3444 def postcommitstatus(repo, pats, opts):
  3445     return repo.status(match=scmutil.match(repo[None], pats, opts))
  3445     return repo.status(match=scmutil.match(repo[None], pats, opts))
  3446 
  3446 
  3447 def revert(ui, repo, ctx, parents, *pats, **opts):
  3447 def revert(ui, repo, ctx, parents, *pats, **opts):
       
  3448     opts = pycompat.byteskwargs(opts)
  3448     parent, p2 = parents
  3449     parent, p2 = parents
  3449     node = ctx.node()
  3450     node = ctx.node()
  3450 
  3451 
  3451     mf = ctx.manifest()
  3452     mf = ctx.manifest()
  3452     if node == p2:
  3453     if node == p2:
  3720 
  3721 
  3721         if targetsubs:
  3722         if targetsubs:
  3722             # Revert the subrepos on the revert list
  3723             # Revert the subrepos on the revert list
  3723             for sub in targetsubs:
  3724             for sub in targetsubs:
  3724                 try:
  3725                 try:
  3725                     wctx.sub(sub).revert(ctx.substate[sub], *pats, **opts)
  3726                     wctx.sub(sub).revert(ctx.substate[sub], *pats,
       
  3727                                          **pycompat.strkwargs(opts))
  3726                 except KeyError:
  3728                 except KeyError:
  3727                     raise error.Abort("subrepository '%s' does not exist in %s!"
  3729                     raise error.Abort("subrepository '%s' does not exist in %s!"
  3728                                       % (sub, short(ctx.node())))
  3730                                       % (sub, short(ctx.node())))
  3729 
  3731 
  3730 def _revertprefetch(repo, ctx, *files):
  3732 def _revertprefetch(repo, ctx, *files):