diff --git a/mercurial/cmdutil.py b/mercurial/cmdutil.py --- a/mercurial/cmdutil.py +++ b/mercurial/cmdutil.py @@ -1332,6 +1332,7 @@ class changeset_printer(object): self.ui.write(self.footer) def show(self, ctx, copies=None, matchfn=None, **props): + props = pycompat.byteskwargs(props) if self.buffered: self.ui.pushbuffer(labeled=True) self._show(ctx, copies, matchfn, props) diff --git a/mercurial/debugcommands.py b/mercurial/debugcommands.py --- a/mercurial/debugcommands.py +++ b/mercurial/debugcommands.py @@ -291,6 +291,7 @@ def _debugchangegroup(ui, gen, all=None, def _debugobsmarkers(ui, part, indent=0, **opts): """display version and markers contained in 'data'""" + opts = pycompat.byteskwargs(opts) data = part.read() indent_string = ' ' * indent try: @@ -511,6 +512,7 @@ def debugdag(ui, repo, file_=None, *revs @command('debugdata', cmdutil.debugrevlogopts, _('-c|-m|FILE REV')) def debugdata(ui, repo, file_, rev=None, **opts): """dump the contents of a data file revision""" + opts = pycompat.byteskwargs(opts) if opts.get('changelog') or opts.get('manifest') or opts.get('dir'): if rev is not None: raise error.CommandError('debugdata', _('invalid arguments')) @@ -567,6 +569,7 @@ def debugdeltachain(ui, repo, file_=None :``extraratio``: extradist divided by chainsize; another representation of how much unrelated data is needed to load this delta chain """ + opts = pycompat.byteskwargs(opts) r = cmdutil.openrevlog(repo, 'debugdeltachain', file_, opts) index = r.index generaldelta = r.version & revlog.FLAG_GENERALDELTA @@ -679,6 +682,7 @@ def debugstate(ui, repo, **opts): _('[-l REV] [-r REV] [-b BRANCH]... [OTHER]')) def debugdiscovery(ui, repo, remoteurl="default", **opts): """runs the changeset discovery protocol in isolation""" + opts = pycompat.byteskwargs(opts) remoteurl, branches = hg.parseurl(ui.expandpath(remoteurl), opts.get('branch')) remote = hg.peer(repo, opts, remoteurl) @@ -740,6 +744,7 @@ def debugdiscovery(ui, repo, remoteurl=" @command('debugextensions', cmdutil.formatteropts, [], norepo=True) def debugextensions(ui, **opts): '''show information about active extensions''' + opts = pycompat.byteskwargs(opts) exts = extensions.extensions(ui) hgver = util.version() fm = ui.formatter('debugextensions', opts) @@ -822,6 +827,7 @@ def debuggetbundle(ui, repopath, bundlep Every ID must be a full-length hex node id string. Saves the bundle to the given file. """ + opts = pycompat.byteskwargs(opts) repo = hg.peer(ui, opts, repopath) if not repo.capable('getbundle'): raise error.Abort("getbundle() not supported by target repository") @@ -891,6 +897,7 @@ def debugignore(ui, repo, *files, **opts optionalrepo=True) def debugindex(ui, repo, file_=None, **opts): """dump the contents of an index file""" + opts = pycompat.byteskwargs(opts) r = cmdutil.openrevlog(repo, 'debugindex', file_, opts) format = opts.get('format', 0) if format not in (0, 1): @@ -945,6 +952,7 @@ def debugindex(ui, repo, file_=None, **o _('-c|-m|FILE'), optionalrepo=True) def debugindexdot(ui, repo, file_=None, **opts): """dump an index DAG as a graphviz dot file""" + opts = pycompat.byteskwargs(opts) r = cmdutil.openrevlog(repo, 'debugindexdot', file_, opts) ui.write(("digraph G {\n")) for i in r: @@ -961,6 +969,7 @@ def debuginstall(ui, **opts): Returns 0 on success. ''' + opts = pycompat.byteskwargs(opts) def writetemp(contents): (fd, name) = tempfile.mkstemp(prefix="hg-debuginstall-") @@ -1129,6 +1138,7 @@ def debugknown(ui, repopath, *ids, **opt Every ID must be a full-length hex node id string. Returns a list of 0s and 1s indicating unknown/known. """ + opts = pycompat.byteskwargs(opts) repo = hg.peer(ui, opts, repopath) if not repo.capable('known'): raise error.Abort("known() not supported by target repository") @@ -1347,6 +1357,8 @@ def debugobsolete(ui, repo, precursor=No With no arguments, displays the list of obsolescence markers.""" + opts = pycompat.byteskwargs(opts) + def parsenodeid(s): try: # We do not use revsingle/revrange functions here to accept @@ -1558,6 +1570,7 @@ def debugpickmergetool(ui, repo, *pats, information, even with --debug. In such case, information above is useful to know why a merge tool is chosen. """ + opts = pycompat.byteskwargs(opts) overrides = {} if opts['tool']: overrides[('ui', 'forcemerge')] = opts['tool'] @@ -1679,6 +1692,7 @@ def debugrebuildfncache(ui, repo): def debugrename(ui, repo, file1, *pats, **opts): """dump rename information""" + opts = pycompat.byteskwargs(opts) ctx = scmutil.revsingle(repo, opts.get('rev')) m = scmutil.match(ctx, (file1,) + pats, opts) for abs in ctx.walk(m): @@ -1696,6 +1710,7 @@ def debugrename(ui, repo, file1, *pats, optionalrepo=True) def debugrevlog(ui, repo, file_=None, **opts): """show data and statistics about a revlog""" + opts = pycompat.byteskwargs(opts) r = cmdutil.openrevlog(repo, 'debugrevlog', file_, opts) if opts.get("dump"): @@ -1943,6 +1958,7 @@ def debugrevspec(ui, repo, expr, **opts) Use --verify-optimized to compare the optimized result with the unoptimized one. Returns 1 if the optimized result differs. """ + opts = pycompat.byteskwargs(opts) stages = [ ('parsed', lambda tree: tree), ('expanded', lambda tree: revsetlang.expandaliases(ui, tree)), @@ -2188,6 +2204,7 @@ def debugupgraderepo(ui, repo, run=False inferrepo=True) def debugwalk(ui, repo, *pats, **opts): """show how files match on given patterns""" + opts = pycompat.byteskwargs(opts) m = scmutil.match(repo[None], pats, opts) ui.write(('matcher: %r\n' % m)) items = list(repo[None].walk(m)) @@ -2211,6 +2228,7 @@ def debugwalk(ui, repo, *pats, **opts): _('REPO [OPTIONS]... [ONE [TWO]]'), norepo=True) def debugwireargs(ui, repopath, *vals, **opts): + opts = pycompat.byteskwargs(opts) repo = hg.peer(ui, opts, repopath) for opt in cmdutil.remoteopts: del opts[opt[1]] diff --git a/mercurial/sshpeer.py b/mercurial/sshpeer.py --- a/mercurial/sshpeer.py +++ b/mercurial/sshpeer.py @@ -12,6 +12,7 @@ import re from .i18n import _ from . import ( error, + pycompat, util, wireproto, ) @@ -259,6 +260,7 @@ class sshpeer(wireproto.wirepeer): yield wireproto.unescapearg(work) def _callstream(self, cmd, **args): + args = pycompat.byteskwargs(args) self.ui.debug("sending %s command\n" % cmd) self.pipeo.write("%s\n" % cmd) _func, names = wireproto.commands[cmd]