commit: keep opts as byteskwargs as much as possible
authorAugie Fackler <augie@google.com>
Sun, 19 Mar 2017 01:20:08 -0400
changeset 31534 2abba5068aa1
parent 31533 28f00d07e2ee
child 31535 d0f95ecca2ad
commit: keep opts as byteskwargs as much as possible This fixes many flag-handling bugs on 'hg commit' in Python 3.
mercurial/commands.py
--- a/mercurial/commands.py	Sun Mar 19 01:19:27 2017 -0400
+++ b/mercurial/commands.py	Sun Mar 19 01:20:08 2017 -0400
@@ -1636,10 +1636,12 @@
         release(lock, wlock)
 
 def _docommit(ui, repo, *pats, **opts):
+    opts = pycompat.byteskwargs(opts)
     if opts.get('interactive'):
         opts.pop('interactive')
         ret = cmdutil.dorecord(ui, repo, commit, None, False,
-                               cmdutil.recordfilter, *pats, **opts)
+                               cmdutil.recordfilter, *pats,
+                               **pycompat.strkwargs(opts))
         # ret can be 0 (no changes to record) or the value returned by
         # commit(), 1 if nothing changed or None on success.
         return 1 if ret == 0 else ret
@@ -1711,7 +1713,8 @@
                 with ui.configoverride(overrides, 'commit'):
                     editform = cmdutil.mergeeditform(repo[None],
                                                      'commit.normal')
-                    editor = cmdutil.getcommiteditor(editform=editform, **opts)
+                    editor = cmdutil.getcommiteditor(
+                        editform=editform, **pycompat.strkwargs(opts))
                     return repo.commit(message,
                                        opts.get('user'),
                                        opts.get('date'),