diff -r 0b5716ec8500 -r 3da4bd50103d mercurial/cmdutil.py --- a/mercurial/cmdutil.py Tue Nov 28 11:00:54 2017 -0500 +++ b/mercurial/cmdutil.py Wed Nov 29 07:57:17 2017 +0530 @@ -3445,6 +3445,7 @@ return repo.status(match=scmutil.match(repo[None], pats, opts)) def revert(ui, repo, ctx, parents, *pats, **opts): + opts = pycompat.byteskwargs(opts) parent, p2 = parents node = ctx.node() @@ -3722,7 +3723,8 @@ # Revert the subrepos on the revert list for sub in targetsubs: try: - wctx.sub(sub).revert(ctx.substate[sub], *pats, **opts) + wctx.sub(sub).revert(ctx.substate[sub], *pats, + **pycompat.strkwargs(opts)) except KeyError: raise error.Abort("subrepository '%s' does not exist in %s!" % (sub, short(ctx.node())))