changeset 34978:de1f045781e0

py3: handle keyword arguments in hgext/gpg.py Differential Revision: https://phab.mercurial-scm.org/D1303
author Pulkit Goyal <7895pulkit@gmail.com>
date Mon, 23 Oct 2017 00:02:46 +0530
parents a56bf5591918
children 29e6513856ee
files hgext/gpg.py
diffstat 1 files changed, 4 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/hgext/gpg.py	Mon Oct 23 00:02:28 2017 +0530
+++ b/hgext/gpg.py	Mon Oct 23 00:02:46 2017 +0530
@@ -106,7 +106,7 @@
 def newgpg(ui, **opts):
     """create a new gpg instance"""
     gpgpath = ui.config("gpg", "cmd")
-    gpgkey = opts.get('key')
+    gpgkey = opts.get(r'key')
     if not gpgkey:
         gpgkey = ui.config("gpg", "key")
     return gpg(gpgpath, gpgkey)
@@ -253,6 +253,7 @@
 
 def _dosign(ui, repo, *revs, **opts):
     mygpg = newgpg(ui, **opts)
+    opts = pycompat.byteskwargs(opts)
     sigver = "0"
     sigmessage = ""
 
@@ -312,7 +313,8 @@
                              % hgnode.short(n)
                              for n in nodes])
     try:
-        editor = cmdutil.getcommiteditor(editform='gpg.sign', **opts)
+        editor = cmdutil.getcommiteditor(editform='gpg.sign',
+                                         **pycompat.strkwargs(opts))
         repo.commit(message, opts['user'], opts['date'], match=msigs,
                     editor=editor)
     except ValueError as inst: