hgext/histedit.py
branchstable
changeset 45011 1bab6b61b62b
parent 44661 e147748f750b
child 45019 4a503c1b664a
equal deleted inserted replaced
45004:2632c1ed8f34 45011:1bab6b61b62b
   199 except ImportError:
   199 except ImportError:
   200     fcntl = None
   200     fcntl = None
   201     termios = None
   201     termios = None
   202 
   202 
   203 import functools
   203 import functools
   204 import locale
       
   205 import os
   204 import os
   206 import struct
   205 import struct
   207 
   206 
   208 from mercurial.i18n import _
   207 from mercurial.i18n import _
   209 from mercurial.pycompat import (
   208 from mercurial.pycompat import (
  1708             )
  1707             )
  1709 
  1708 
  1710         ctxs = []
  1709         ctxs = []
  1711         for i, r in enumerate(revs):
  1710         for i, r in enumerate(revs):
  1712             ctxs.append(histeditrule(ui, repo[r], i))
  1711             ctxs.append(histeditrule(ui, repo[r], i))
  1713         # Curses requires setting the locale or it will default to the C
  1712         with util.with_lc_ctype():
  1714         # locale. This sets the locale to the user's default system
  1713             rc = curses.wrapper(functools.partial(_chisteditmain, repo, ctxs))
  1715         # locale.
       
  1716         locale.setlocale(locale.LC_ALL, '')
       
  1717         rc = curses.wrapper(functools.partial(_chisteditmain, repo, ctxs))
       
  1718         curses.echo()
  1714         curses.echo()
  1719         curses.endwin()
  1715         curses.endwin()
  1720         if rc is False:
  1716         if rc is False:
  1721             ui.write(_(b"histedit aborted\n"))
  1717             ui.write(_(b"histedit aborted\n"))
  1722             return 0
  1718             return 0