hgext/win32text.py
changeset 34197 f84358f75978
parent 31346 ec7831675867
child 35675 01496e9269f9
equal deleted inserted replaced
34196:b5bbfe176004 34197:f84358f75978
    47 from mercurial.i18n import _
    47 from mercurial.i18n import _
    48 from mercurial.node import (
    48 from mercurial.node import (
    49     short,
    49     short,
    50 )
    50 )
    51 from mercurial import (
    51 from mercurial import (
       
    52     registrar,
    52     util,
    53     util,
    53 )
    54 )
    54 
    55 
    55 # Note for extension authors: ONLY specify testedwith = 'ships-with-hg-core' for
    56 # Note for extension authors: ONLY specify testedwith = 'ships-with-hg-core' for
    56 # extensions which SHIP WITH MERCURIAL. Non-mainline extensions should
    57 # extensions which SHIP WITH MERCURIAL. Non-mainline extensions should
    57 # be specifying the version(s) of Mercurial they are tested with, or
    58 # be specifying the version(s) of Mercurial they are tested with, or
    58 # leave the attribute unspecified.
    59 # leave the attribute unspecified.
    59 testedwith = 'ships-with-hg-core'
    60 testedwith = 'ships-with-hg-core'
       
    61 
       
    62 configtable = {}
       
    63 configitem = registrar.configitem(configtable)
       
    64 
       
    65 configitem('win32text', 'warn',
       
    66     default=True,
       
    67 )
    60 
    68 
    61 # regexp for single LF without CR preceding.
    69 # regexp for single LF without CR preceding.
    62 re_single_lf = re.compile('(^|[^\r])\n', re.MULTILINE)
    70 re_single_lf = re.compile('(^|[^\r])\n', re.MULTILINE)
    63 
    71 
    64 newlinestr = {'\r\n': 'CRLF', '\r': 'CR'}
    72 newlinestr = {'\r\n': 'CRLF', '\r': 'CR'}
   176     for name, fn in _filters.iteritems():
   184     for name, fn in _filters.iteritems():
   177         repo.adddatafilter(name, fn)
   185         repo.adddatafilter(name, fn)
   178 
   186 
   179 def extsetup(ui):
   187 def extsetup(ui):
   180     # deprecated config: win32text.warn
   188     # deprecated config: win32text.warn
   181     if ui.configbool('win32text', 'warn', True):
   189     if ui.configbool('win32text', 'warn'):
   182         ui.warn(_("win32text is deprecated: "
   190         ui.warn(_("win32text is deprecated: "
   183                   "https://mercurial-scm.org/wiki/Win32TextExtension\n"))
   191                   "https://mercurial-scm.org/wiki/Win32TextExtension\n"))