comparison mercurial/localrepo.py @ 36400:7b86aa31b004

py3: fix handling of keyword arguments at more places The keys of keyword arguments of Python 3 should be str, which is why we need to prevent getting the b'' prefix added by the transformer or convert keys to str using pycompat.strkwargs() Differential Revision: https://phab.mercurial-scm.org/D2420
author Pulkit Goyal <7895pulkit@gmail.com>
date Sat, 24 Feb 2018 16:18:40 +0530
parents 0147a4730420
children 04c319a07c7b
comparison
equal deleted inserted replaced
36399:a24c57f1f5c3 36400:7b86aa31b004
2168 try: 2168 try:
2169 tr = self.currenttransaction() 2169 tr = self.currenttransaction()
2170 hookargs = {} 2170 hookargs = {}
2171 if tr is not None: 2171 if tr is not None:
2172 hookargs.update(tr.hookargs) 2172 hookargs.update(tr.hookargs)
2173 hookargs['namespace'] = namespace 2173 hookargs = pycompat.strkwargs(hookargs)
2174 hookargs['key'] = key 2174 hookargs[r'namespace'] = namespace
2175 hookargs['old'] = old 2175 hookargs[r'key'] = key
2176 hookargs['new'] = new 2176 hookargs[r'old'] = old
2177 hookargs[r'new'] = new
2177 self.hook('prepushkey', throw=True, **hookargs) 2178 self.hook('prepushkey', throw=True, **hookargs)
2178 except error.HookAbort as exc: 2179 except error.HookAbort as exc:
2179 self.ui.write_err(_("pushkey-abort: %s\n") % exc) 2180 self.ui.write_err(_("pushkey-abort: %s\n") % exc)
2180 if exc.hint: 2181 if exc.hint:
2181 self.ui.write_err(_("(%s)\n") % exc.hint) 2182 self.ui.write_err(_("(%s)\n") % exc.hint)