hgext/win32mbcs.py
changeset 26587 56b2bcea2529
parent 25186 80c5b2666a96
child 28417 588874c33b4d
equal deleted inserted replaced
26586:d51c658d3f04 26587:56b2bcea2529
    45 It is useful for the users who want to commit with UTF-8 log message.
    45 It is useful for the users who want to commit with UTF-8 log message.
    46 '''
    46 '''
    47 
    47 
    48 import os, sys
    48 import os, sys
    49 from mercurial.i18n import _
    49 from mercurial.i18n import _
    50 from mercurial import util, encoding
    50 from mercurial import error, encoding
    51 # Note for extension authors: ONLY specify testedwith = 'internal' for
    51 # Note for extension authors: ONLY specify testedwith = 'internal' for
    52 # extensions which SHIP WITH MERCURIAL. Non-mainline extensions should
    52 # extensions which SHIP WITH MERCURIAL. Non-mainline extensions should
    53 # be specifying the version(s) of Mercurial they are tested with, or
    53 # be specifying the version(s) of Mercurial they are tested with, or
    54 # leave the attribute unspecified.
    54 # leave the attribute unspecified.
    55 testedwith = 'internal'
    55 testedwith = 'internal'
   103     try:
   103     try:
   104         # convert string arguments, call func, then convert back the
   104         # convert string arguments, call func, then convert back the
   105         # return value.
   105         # return value.
   106         return enc(func(*dec(args), **dec(kwds)))
   106         return enc(func(*dec(args), **dec(kwds)))
   107     except UnicodeError:
   107     except UnicodeError:
   108         raise util.Abort(_("[win32mbcs] filename conversion failed with"
   108         raise error.Abort(_("[win32mbcs] filename conversion failed with"
   109                          " %s encoding\n") % (_encoding))
   109                          " %s encoding\n") % (_encoding))
   110 
   110 
   111 def wrapper(func, args, kwds):
   111 def wrapper(func, args, kwds):
   112     return basewrapper(func, unicode, encode, decode, args, kwds)
   112     return basewrapper(func, unicode, encode, decode, args, kwds)
   113 
   113