comparison mercurial/crecord.py @ 26587:56b2bcea2529

error: get Abort from 'error' instead of 'util' The home of 'Abort' is 'error' not 'util' however, a lot of code seems to be confused about that and gives all the credit to 'util' instead of the hardworking 'error'. In a spirit of equity, we break the cycle of injustice and give back to 'error' the respect it deserves. And screw that 'util' poser. For great justice.
author Pierre-Yves David <pierre-yves.david@fb.com>
date Thu, 08 Oct 2015 12:55:45 -0700
parents 4b0fc75f9403
children 1aee2ab0f902
comparison
equal deleted inserted replaced
26586:d51c658d3f04 26587:56b2bcea2529
20 import tempfile 20 import tempfile
21 21
22 from .i18n import _ 22 from .i18n import _
23 from . import ( 23 from . import (
24 encoding, 24 encoding,
25 error,
25 patch as patchmod, 26 patch as patchmod,
26 util,
27 ) 27 )
28 28
29 # This is required for ncurses to display non-ASCII characters in default user 29 # This is required for ncurses to display non-ASCII characters in default user
30 # locale encoding correctly. --immerrr 30 # locale encoding correctly. --immerrr
31 locale.setlocale(locale.LC_ALL, '') 31 locale.setlocale(locale.LC_ALL, '')
45 45
46 try: 46 try:
47 curses 47 curses
48 except NameError: 48 except NameError:
49 if os.name != 'nt': # Temporary hack to get running on Windows again 49 if os.name != 'nt': # Temporary hack to get running on Windows again
50 raise util.Abort( 50 raise error.Abort(
51 _('the python curses/wcurses module is not available/installed')) 51 _('the python curses/wcurses module is not available/installed'))
52 52
53 _origstdout = sys.__stdout__ # used by gethw() 53 _origstdout = sys.__stdout__ # used by gethw()
54 54
55 class patchnode(object): 55 class patchnode(object):
496 ui.write(_('starting interactive selection\n')) 496 ui.write(_('starting interactive selection\n'))
497 chunkselector = curseschunkselector(headerlist, ui) 497 chunkselector = curseschunkselector(headerlist, ui)
498 f = signal.getsignal(signal.SIGTSTP) 498 f = signal.getsignal(signal.SIGTSTP)
499 curses.wrapper(chunkselector.main) 499 curses.wrapper(chunkselector.main)
500 if chunkselector.initerr is not None: 500 if chunkselector.initerr is not None:
501 raise util.Abort(chunkselector.initerr) 501 raise error.Abort(chunkselector.initerr)
502 # ncurses does not restore signal handler for SIGTSTP 502 # ncurses does not restore signal handler for SIGTSTP
503 signal.signal(signal.SIGTSTP, f) 503 signal.signal(signal.SIGTSTP, f)
504 504
505 def testdecorator(testfn, f): 505 def testdecorator(testfn, f):
506 def u(*args, **kwargs): 506 def u(*args, **kwargs):
1564 elif keypressed in ["h", "KEY_LEFT"]: 1564 elif keypressed in ["h", "KEY_LEFT"]:
1565 self.leftarrowevent() 1565 self.leftarrowevent()
1566 elif keypressed in ["H", "KEY_SLEFT"]: 1566 elif keypressed in ["H", "KEY_SLEFT"]:
1567 self.leftarrowshiftevent() 1567 self.leftarrowshiftevent()
1568 elif keypressed in ["q"]: 1568 elif keypressed in ["q"]:
1569 raise util.Abort(_('user quit')) 1569 raise error.Abort(_('user quit'))
1570 elif keypressed in ["c"]: 1570 elif keypressed in ["c"]:
1571 if self.confirmcommit(): 1571 if self.confirmcommit():
1572 return True 1572 return True
1573 elif keypressed in ["r"]: 1573 elif keypressed in ["r"]:
1574 if self.confirmcommit(review=True): 1574 if self.confirmcommit(review=True):