comparison hgext/histedit.py @ 41223:32ef47b3c91c

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
author Augie Fackler <augie@google.com>
date Mon, 14 Jan 2019 22:19:43 -0500
parents 704a3aa3dc0a
children 0bd56c291359
comparison
equal deleted inserted replaced
41222:8aca89a694d4 41223:32ef47b3c91c
1602 conflicts). 1602 conflicts).
1603 """ 1603 """
1604 # kludge: _chistedit only works for starting an edit, not aborting 1604 # kludge: _chistedit only works for starting an edit, not aborting
1605 # or continuing, so fall back to regular _texthistedit for those 1605 # or continuing, so fall back to regular _texthistedit for those
1606 # operations. 1606 # operations.
1607 if ui.interface('histedit') == 'curses' and _getgoal(opts) == goalnew: 1607 if ui.interface('histedit') == 'curses' and _getgoal(
1608 pycompat.byteskwargs(opts)) == goalnew:
1608 return _chistedit(ui, repo, *freeargs, **opts) 1609 return _chistedit(ui, repo, *freeargs, **opts)
1609 return _texthistedit(ui, repo, *freeargs, **opts) 1610 return _texthistedit(ui, repo, *freeargs, **opts)
1610 1611
1611 def _texthistedit(ui, repo, *freeargs, **opts): 1612 def _texthistedit(ui, repo, *freeargs, **opts):
1612 state = histeditstate(repo) 1613 state = histeditstate(repo)
1619 goalabort = 'abort' 1620 goalabort = 'abort'
1620 goaleditplan = 'edit-plan' 1621 goaleditplan = 'edit-plan'
1621 goalnew = 'new' 1622 goalnew = 'new'
1622 1623
1623 def _getgoal(opts): 1624 def _getgoal(opts):
1624 if opts.get('continue'): 1625 if opts.get(b'continue'):
1625 return goalcontinue 1626 return goalcontinue
1626 if opts.get('abort'): 1627 if opts.get(b'abort'):
1627 return goalabort 1628 return goalabort
1628 if opts.get('edit_plan'): 1629 if opts.get(b'edit_plan'):
1629 return goaleditplan 1630 return goaleditplan
1630 return goalnew 1631 return goalnew
1631 1632
1632 def _readfile(ui, path): 1633 def _readfile(ui, path):
1633 if path == '-': 1634 if path == '-':