##// END OF EJS Templates
histedit: py3 fixes for curses mode...
Steve Fink -
r44892:9b8e13a0 stable
parent child Browse files
Show More
@@ -1645,7 +1645,7 b' pgup/K: move patch up, pgdn/J: move patc'
1645 pass
1645 pass
1646
1646
1647
1647
1648 def _chistedit(ui, repo, *freeargs, **opts):
1648 def _chistedit(ui, repo, freeargs, opts):
1649 """interactively edit changeset history via a curses interface
1649 """interactively edit changeset history via a curses interface
1650
1650
1651 Provides a ncurses interface to histedit. Press ? in chistedit mode
1651 Provides a ncurses interface to histedit. Press ? in chistedit mode
@@ -1717,8 +1717,8 b' def _chistedit(ui, repo, *freeargs, **op'
1717 with repo.vfs(b'chistedit', b'w+') as fp:
1717 with repo.vfs(b'chistedit', b'w+') as fp:
1718 for r in rules:
1718 for r in rules:
1719 fp.write(r)
1719 fp.write(r)
1720 opts['commands'] = fp.name
1720 opts[b'commands'] = fp.name
1721 return _texthistedit(ui, repo, *freeargs, **opts)
1721 return _texthistedit(ui, repo, freeargs, opts)
1722 except KeyboardInterrupt:
1722 except KeyboardInterrupt:
1723 pass
1723 pass
1724 return -1
1724 return -1
@@ -1855,23 +1855,25 b' def histedit(ui, repo, *freeargs, **opts'
1855 for intentional "edit" command, but also for resolving unexpected
1855 for intentional "edit" command, but also for resolving unexpected
1856 conflicts).
1856 conflicts).
1857 """
1857 """
1858 opts = pycompat.byteskwargs(opts)
1859
1858 # kludge: _chistedit only works for starting an edit, not aborting
1860 # kludge: _chistedit only works for starting an edit, not aborting
1859 # or continuing, so fall back to regular _texthistedit for those
1861 # or continuing, so fall back to regular _texthistedit for those
1860 # operations.
1862 # operations.
1861 if (
1863 if (
1862 ui.interface(b'histedit') == b'curses'
1864 ui.interface(b'histedit') == b'curses'
1863 and _getgoal(pycompat.byteskwargs(opts)) == goalnew
1865 and _getgoal(opts) == goalnew
1864 ):
1866 ):
1865 return _chistedit(ui, repo, *freeargs, **opts)
1867 return _chistedit(ui, repo, freeargs, opts)
1866 return _texthistedit(ui, repo, *freeargs, **opts)
1868 return _texthistedit(ui, repo, freeargs, opts)
1867
1869
1868
1870
1869 def _texthistedit(ui, repo, *freeargs, **opts):
1871 def _texthistedit(ui, repo, freeargs, opts):
1870 state = histeditstate(repo)
1872 state = histeditstate(repo)
1871 with repo.wlock() as wlock, repo.lock() as lock:
1873 with repo.wlock() as wlock, repo.lock() as lock:
1872 state.wlock = wlock
1874 state.wlock = wlock
1873 state.lock = lock
1875 state.lock = lock
1874 _histedit(ui, repo, state, *freeargs, **opts)
1876 _histedit(ui, repo, state, freeargs, opts)
1875
1877
1876
1878
1877 goalcontinue = b'continue'
1879 goalcontinue = b'continue'
@@ -1952,8 +1954,7 b' def _validateargs(ui, repo, state, freea'
1952 )
1954 )
1953
1955
1954
1956
1955 def _histedit(ui, repo, state, *freeargs, **opts):
1957 def _histedit(ui, repo, state, freeargs, opts):
1956 opts = pycompat.byteskwargs(opts)
1957 fm = ui.formatter(b'histedit', opts)
1958 fm = ui.formatter(b'histedit', opts)
1958 fm.startitem()
1959 fm.startitem()
1959 goal = _getgoal(opts)
1960 goal = _getgoal(opts)
General Comments 0
You need to be logged in to leave comments. Login now