cvs2hg emit .hgeol?

Greg Ward greg-hg at gerg.ca
Wed Aug 24 23:47:35 UTC 2011


> Unfortunately, I am probably not the person to do this.  I am in a Windows C++ shop so
> not only do I not know a damn thing about Python, I don't have a Python tool chain set
> up that would let me poke at it.  I would be starting literally from zero.

Toolchain? You are thinking like a Windows C++ guy. The toolchain for
Python is Python. And a text editor. I gather some people like IDEs
(e.g. Eclipse, WingIDE), but I've never really seen the point. I
prefer to just inhale the code base and start walking up the learning
cliff. ;-)

That said, customizing a cvs2hg run really would be jumping in the
deep end. You have to figure out both the zen of cvs2svn and the tao
of Mercurial. I'm still amazed I got the thing to work as well is it
does.

> Actually, there is some hoseage (if you will).  The CVS repo we had was
> running on linux.  Everything was checked out on Windows.  For whatever
> reason (my understanding is that the CVS internal eol format, at least on
> unix, is unix style) everything in the hg repo is unix style eol. Thus they
> currently get checked out on my Windows machine this way.
>
> This is not actually a problem for most files because the editors and
> compilers can handle either style eol.  The most notable exceptions are
> notepad (the default windows editor) which is only a problem in the sense of
> "it would be nice to work", and the resource compiler, which is not
> optional.  It completely barfs on RC files with the wrong ending style.

Boy, does this ever sound familiar. I bet you also have some files in
CVS with inconsistent line endings too -- we did. I dealt with these
problems in a couple of ways when converting to hg:

  * if it's known to be a text file (*.c, *.java, etc): convert the content
    of *every revision* to Unix line endings -- so in our hg repo, it's \n
    all the way

  * Windows RC files (and Visual Studio .vcproj) are not text, despite
appearances:
    treat them as binary (i.e. they should have CR LF in the repo, in
a Unix checkout,
    and of course in a Windows checkout)

So yeah, I tampered with history by hooking into the guts of cvs2hg.
The power was intoxicating.

Greg



More information about the Mercurial mailing list