[opensource-dev] Help prevent DOS line endings...
discrete.dreamscape at gmail.com
Wed Feb 2 15:33:31 PST 2011
This is from the help page on the extension:
The optional "[repository]" section specifies the line endings to use for
in the repository. It has a single setting, "native", which determines the
endings for files declared as "native" in the "[patterns]" section. It can
be set to
"LF" or "CRLF". The default is "LF". For example, this means that on
configured as "native" ("CRLF" by default) will be converted to "LF" when
stored in the
repository. Files declared as "LF", "CRLF", or "BIN" in the "[patterns]"
always stored as-is in the repository.
Example versioned ".hgeol" file:
**.py = native
**.vcproj = CRLF
**.txt = native
Makefile = LF
**.jpg = BIN
native = LF
So if a file pattern is specifically declared to have Windows line-endings,
it should remain that way for everyone and in the repository.. probably
worth some quick testing.
On Wed, Feb 2, 2011 at 3:06 PM, Oz Linden (Scott Lawrence) <oz at lindenlab.com
> On 2011-02-01 15:33, Discrete Dreamscape wrote:
>> Possible cover-all solution: use Mercurial's "eol" extension. It's worked
>> pretty well for me so far, and handily autofixed all the DOS endings in a
>> particular fork I looked at in one go. It works much like the autoprops
>> configuration does in Subversion; hopefully with less pain.
>> Enable it (should be included by default in all recent versions, dunno
>> about Tortoise) by adding the following section and options to your
>> system-wide or repo-local .hgrc file:
>> eol =
>> Then add a ".hgeol" file to the root of the repository (it can be
>> versioned and thus easily distributed!), and fill it with whatever standard
>> Mercurial pattern entries are needed, like so:
>> **.py = native
>> **.txt = native
>> **.h = native
>> **.cpp = native
>> **Makefile = LF
>> As soon as this file exists and the extension is active for you, further
>> hg commands will immediately treat any non-conforming line-endings as
>> modifications to your current working copy. Hope this is helpful; if so, it
>> could be added to that page as well.
> I considered adding that, but didn't know whether some of the
> windows-specific files might be broken by it (if so, they too could be
> configured). Does anyone know?
> Could always put this into a test repo and run a TeamCity build....
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the opensource-dev