comparison hgext/eol.py @ 14856:9f5cd6b6d758

eol: document new eol.fix-trailing-newline setting
author Martin Geisler <mg@aragost.com>
date Thu, 07 Jul 2011 12:13:07 +0200
parents f33579435378
children 5b46c16e7121
comparison
equal deleted inserted replaced
14855:f33579435378 14856:9f5cd6b6d758
50 50
51 .. note:: 51 .. note::
52 The rules will first apply when files are touched in the working 52 The rules will first apply when files are touched in the working
53 copy, e.g. by updating to null and back to tip to touch all files. 53 copy, e.g. by updating to null and back to tip to touch all files.
54 54
55 The extension uses an optional ``[eol]`` section in your hgrc file 55 The extension uses an optional ``[eol]`` section read from both the
56 (not the ``.hgeol`` file) for settings that control the overall 56 normal Mercurial configuration files and the ``.hgeol`` file, with the
57 behavior. There are two settings: 57 latter overriding the former. You can use that section to control the
58 overall behavior. There are three settings:
58 59
59 - ``eol.native`` (default ``os.linesep``) can be set to ``LF`` or 60 - ``eol.native`` (default ``os.linesep``) can be set to ``LF`` or
60 ``CRLF`` to override the default interpretation of ``native`` for 61 ``CRLF`` to override the default interpretation of ``native`` for
61 checkout. This can be used with :hg:`archive` on Unix, say, to 62 checkout. This can be used with :hg:`archive` on Unix, say, to
62 generate an archive where files have line endings for Windows. 63 generate an archive where files have line endings for Windows.
64 - ``eol.only-consistent`` (default True) can be set to False to make 65 - ``eol.only-consistent`` (default True) can be set to False to make
65 the extension convert files with inconsistent EOLs. Inconsistent 66 the extension convert files with inconsistent EOLs. Inconsistent
66 means that there is both ``CRLF`` and ``LF`` present in the file. 67 means that there is both ``CRLF`` and ``LF`` present in the file.
67 Such files are normally not touched under the assumption that they 68 Such files are normally not touched under the assumption that they
68 have mixed EOLs on purpose. 69 have mixed EOLs on purpose.
70
71 - ``eol.fix-trailing-newline`` (default False) can be set to True to
72 ensure that converted files end with a EOL character (either ``\n``
73 or ``\r\n`` as per the configured patterns).
69 74
70 The extension provides ``cleverencode:`` and ``cleverdecode:`` filters 75 The extension provides ``cleverencode:`` and ``cleverdecode:`` filters
71 like the deprecated win32text extension does. This means that you can 76 like the deprecated win32text extension does. This means that you can
72 disable win32text and enable eol and your filters will still work. You 77 disable win32text and enable eol and your filters will still work. You
73 only need to these filters until you have prepared a ``.hgeol`` file. 78 only need to these filters until you have prepared a ``.hgeol`` file.