Patchwork D8150: histedit: py3 fixes for curses mode

login
register
mail settings
Submitter phabricator
Date March 3, 2020, 7:26 a.m.
Message ID <3f0d53661ec89ce47451f27278389d49@localhost.localdomain>
Download mbox | patch
Permalink /patch/45423/
State Not Applicable
Headers show

Comments

phabricator - March 3, 2020, 7:26 a.m.
Closed by commit rHG9b8e13a038db: histedit: py3 fixes for curses mode (authored by Steve Fink &lt;sfink@mozilla.com&gt;).
This revision was automatically updated to reflect the committed changes.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D8150?vs=20302&id=20417

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D8150/new/

REVISION DETAIL
  https://phab.mercurial-scm.org/D8150

AFFECTED FILES
  hgext/histedit.py

CHANGE DETAILS




To: sfink, durin42, #hg-reviewers, pulkit
Cc: mercurial-devel

Patch

diff --git a/hgext/histedit.py b/hgext/histedit.py
--- a/hgext/histedit.py
+++ b/hgext/histedit.py
@@ -1645,7 +1645,7 @@ 
             pass
 
 
-def _chistedit(ui, repo, *freeargs, **opts):
+def _chistedit(ui, repo, freeargs, opts):
     """interactively edit changeset history via a curses interface
 
     Provides a ncurses interface to histedit. Press ? in chistedit mode
@@ -1717,8 +1717,8 @@ 
             with repo.vfs(b'chistedit', b'w+') as fp:
                 for r in rules:
                     fp.write(r)
-                opts['commands'] = fp.name
-            return _texthistedit(ui, repo, *freeargs, **opts)
+                opts[b'commands'] = fp.name
+            return _texthistedit(ui, repo, freeargs, opts)
     except KeyboardInterrupt:
         pass
     return -1
@@ -1855,23 +1855,25 @@ 
     for intentional "edit" command, but also for resolving unexpected
     conflicts).
     """
+    opts = pycompat.byteskwargs(opts)
+
     # kludge: _chistedit only works for starting an edit, not aborting
     # or continuing, so fall back to regular _texthistedit for those
     # operations.
     if (
         ui.interface(b'histedit') == b'curses'
-        and _getgoal(pycompat.byteskwargs(opts)) == goalnew
+        and _getgoal(opts) == goalnew
     ):
-        return _chistedit(ui, repo, *freeargs, **opts)
-    return _texthistedit(ui, repo, *freeargs, **opts)
-
-
-def _texthistedit(ui, repo, *freeargs, **opts):
+        return _chistedit(ui, repo, freeargs, opts)
+    return _texthistedit(ui, repo, freeargs, opts)
+
+
+def _texthistedit(ui, repo, freeargs, opts):
     state = histeditstate(repo)
     with repo.wlock() as wlock, repo.lock() as lock:
         state.wlock = wlock
         state.lock = lock
-        _histedit(ui, repo, state, *freeargs, **opts)
+        _histedit(ui, repo, state, freeargs, opts)
 
 
 goalcontinue = b'continue'
@@ -1952,8 +1954,7 @@ 
                 )
 
 
-def _histedit(ui, repo, state, *freeargs, **opts):
-    opts = pycompat.byteskwargs(opts)
+def _histedit(ui, repo, state, freeargs, opts):
     fm = ui.formatter(b'histedit', opts)
     fm.startitem()
     goal = _getgoal(opts)