hgext/histedit.py
changeset 45022 d2227d4c9e6b
parent 44915 b7808443ed6a
child 45032 a65c60f3280e
equal deleted inserted replaced
45021:a25343d16ebe 45022:d2227d4c9e6b
   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 (
  1709             )
  1708             )
  1710 
  1709 
  1711         ctxs = []
  1710         ctxs = []
  1712         for i, r in enumerate(revs):
  1711         for i, r in enumerate(revs):
  1713             ctxs.append(histeditrule(ui, repo[r], i))
  1712             ctxs.append(histeditrule(ui, repo[r], i))
  1714         # Curses requires setting the locale or it will default to the C
       
  1715         # locale. This sets the locale to the user's default system
       
  1716         # locale.
       
  1717         locale.setlocale(locale.LC_ALL, '')
       
  1718         rc = curses.wrapper(functools.partial(_chisteditmain, repo, ctxs))
  1713         rc = curses.wrapper(functools.partial(_chisteditmain, repo, ctxs))
  1719         curses.echo()
  1714         curses.echo()
  1720         curses.endwin()
  1715         curses.endwin()
  1721         if rc is False:
  1716         if rc is False:
  1722             ui.write(_(b"histedit aborted\n"))
  1717             ui.write(_(b"histedit aborted\n"))