Convert the end of line pattern in a Mercurial repository
Asked Answered
E

1

6

I have a repository that was populated with files with Windows end of line markers, but I intended to use the Unix EOL pattern.

One option is to manually (dos2unix) change all the files, then commit a changeset that completely overwrites the repository. I can do this if necessary, but I'd like to avoid it. Is it possible, using hg convert or otherwise, to rebuild the repository using a different EOL marker? I considered exporting all of the changes, converting those, and rebuilding the repository that way, but the Mercurial wiki suggests export should not be trusted on merge changesets, which seems to rule out that option.

I want to avoid using the EOL extension if possible.

Essive answered 31/3, 2011 at 3:48 Comment(0)
S
3

I know you want to avoid the eolExtension, but it seems the least disruptive solution to me:

It would ensure that, from now on, any working copy respect your EOL after an hg update, and that setting would propagate through clones.

Stlouis answered 31/3, 2011 at 4:15 Comment(2)
I can fix my editor so that it is using Unix EOL by default, so that's not a problem. But I'd like to avoid a replace-every-line-of-every-file changeset to change the codebase to Unix. So I'm looking for ways of changing the history of the repository to be using Unix EOL.Essive
@Martin: you can limit the change to only future changeset, and for only certain type of files.Stlouis

© 2022 - 2024 — McMap. All rights reserved.