views:

218

answers:

3

I recently converted a CVS repository to Mercurial. From the looks of it, everything went perfect. Except that every end-of-line character is in Unix style and I want them in Windows style.

I know the hg convert command can be used to "convert" a Mercurial repository to a Mercurial repository. Can I use it to do nothing on the repos but fix the line endings?

A: 

One way is to use whatever tool that normalizes line endings and run it on every file in a checked out copy then commit every file. But that should be considered a last resort solution since it will make the history "dirty" (files will appear to have been changed when they practically have not been).

mizipzor
+1  A: 

I don't think there's an easy way to get hg convert to do what you want (short of writing code that plugs into convert's code. Unfortunately, convert's hg-to-hg conversions are also not entirely clean, due to the generalized model convert has. This may not be a problem if you're coming from CVS, though.

djc
+3  A: 

How they're stored in the repo isn't terribly important since you do your actual work with the checked out working directory, whose line endings you can control at update time using either of these extensions:

more detail is available here: http://mercurial.selenic.com/wiki/EOLTranslationPlan

Ry4an
From the looks of it, hg-eol extension seems to the best currently available solution. Would it allow me to convert, upon cloning, every eol to a specified one? Is it converted back upon commit? I do agree though that the eol character in the stored repo shouldnt matter.
mizipzor