histedit: fix call to _getgoal() by adding a byteskwargs() wrapper
authorAugie Fackler <augie@google.com>
Mon, 14 Jan 2019 22:19:43 -0500
changeset 41223 32ef47b3c91c
parent 41222 8aca89a694d4
child 41224 b129837190f7
histedit: fix call to _getgoal() by adding a byteskwargs() wrapper I also added some b-prefixes while I was here because I got confused and it seems silly to not just add them since it clarifies the whole change. Differential Revision: https://phab.mercurial-scm.org/D5585
hgext/histedit.py
--- a/hgext/histedit.py	Fri Jan 04 13:41:21 2019 +0100
+++ b/hgext/histedit.py	Mon Jan 14 22:19:43 2019 -0500
@@ -1604,7 +1604,8 @@
     # kludge: _chistedit only works for starting an edit, not aborting
     # or continuing, so fall back to regular _texthistedit for those
     # operations.
-    if ui.interface('histedit') == 'curses' and  _getgoal(opts) == goalnew:
+    if ui.interface('histedit') == 'curses' and  _getgoal(
+            pycompat.byteskwargs(opts)) == goalnew:
         return _chistedit(ui, repo, *freeargs, **opts)
     return _texthistedit(ui, repo, *freeargs, **opts)
 
@@ -1621,11 +1622,11 @@
 goalnew = 'new'
 
 def _getgoal(opts):
-    if opts.get('continue'):
+    if opts.get(b'continue'):
         return goalcontinue
-    if opts.get('abort'):
+    if opts.get(b'abort'):
         return goalabort
-    if opts.get('edit_plan'):
+    if opts.get(b'edit_plan'):
         return goaleditplan
     return goalnew