From 43464e00e4e9ecc42fd69e52c283d182a88f16a0 Mon Sep 17 00:00:00 2001 From: Pulkit Goyal <7895pulkit@gmail.com> Date: Sat, 17 Jun 2017 15:29:26 +0530 Subject: [PATCH] py3: convert keys of kwargs back to bytes using pycompat.byteskwargs() --- hgext/strip.py | 2 ++ mercurial/formatter.py | 1 + mercurial/hook.py | 1 + 3 files changed, 4 insertions(+) diff --git a/hgext/strip.py b/hgext/strip.py index bb827639ff..5b375a207b 100644 --- a/hgext/strip.py +++ b/hgext/strip.py @@ -14,6 +14,7 @@ from mercurial import ( lock as lockmod, merge, node as nodemod, + pycompat, registrar, repair, scmutil, @@ -133,6 +134,7 @@ def stripcmd(ui, repo, *revs, **opts): Return 0 on success. """ + opts = pycompat.byteskwargs(opts) backup = True if opts.get('no_backup') or opts.get('nobackup'): backup = False diff --git a/mercurial/formatter.py b/mercurial/formatter.py index 5603a0051d..dfe4251e12 100644 --- a/mercurial/formatter.py +++ b/mercurial/formatter.py @@ -354,6 +354,7 @@ class templateformatter(baseformatter): self._cache = {} # for templatekw/funcs to store reusable data def context(self, **ctxs): '''insert context objects to be used to render template keywords''' + ctxs = pycompat.byteskwargs(ctxs) assert all(k == 'ctx' for k in ctxs) self._item.update(ctxs) def _showitem(self): diff --git a/mercurial/hook.py b/mercurial/hook.py index 0cc65ab7ee..0d539cb29f 100644 --- a/mercurial/hook.py +++ b/mercurial/hook.py @@ -205,6 +205,7 @@ def hook(ui, repo, htype, throw=False, **args): return r def runhooks(ui, repo, htype, hooks, throw=False, **args): + args = pycompat.byteskwargs(args) res = {} oldstdout = -1