title: Convert CVS to Hg on Windows
body: <p>I'm trying to convert our company's CVS to Mercurial but so far without success. Remote file history should be retained.</p>
  
  <p>I tried the conversion tools described on <a href="http://mercurial.selenic.com/wiki/RepositoryConversion#CVS" rel="nofollow noreferrer">RepositoryConversion - Mercurial</a></p>
  
  <h2>Convert extension</h2>
  
  <pre><code>e:\Hg&gt;hg convert -s CVS H:\Cvs
  assuming destination cvs-hg
  initializing destination cvs-hg repository
  abort: CVS: invalid source repository type
  </code></pre>
  
  <p>What's going on!?</p>
  
  <h2>cvs2hg</h2>
  
  <p>Looks very promising, but errors out at the last moment.</p>
  
  <pre><code>python cvs2hg -v --encoding=UTF8 --hgrepos=e:/Hg h:/Cvs
  </code></pre>
  
  <p>Result after 10 minutes and 9 miles of text:</p>
  
  <pre><code>----- pass 14 (SortSymbolOpeningsClosingsPass) -----
  Sorting symbolic name source revisions...
  Done
  Time for pass14 (SortSymbolOpeningsClosingsPass): 0.150 seconds.
  Deleting cvs2svn-tmp\statistics-13.pck
  Deleting cvs2svn-tmp\symbolic-names.txt
  ----- pass 15 (IndexSymbolsPass) -----
  Determining offsets for all symbolic names...
    VERSION_0_22
    VERSION_0_18
    VERSION_0_11
    VERSION_0_9
    VERSION_0_5
    VERSION_0_1
  Done.
  Time for pass15 (IndexSymbolsPass): 0.130 seconds.
  Deleting cvs2svn-tmp\statistics-14.pck
  ----- pass 16 (OutputPass) -----
  Traceback (most recent call last):
    File "cvs2hg", line 91, in &lt;module&gt;
      hg_main(os.path.basename(sys.argv[0]), sys.argv[1:])
    File "c:\Portable progs\cvs2svn-19b322d42b1f\cvs2svn_lib\main.py", line 135, in hg_main
      main(progname, run_options, pass_manager)
    File "c:\Portable progs\cvs2svn-19b322d42b1f\cvs2svn_lib\main.py", line 96, in main
      pass_manager.run(run_options)
    File "c:\Portable progs\cvs2svn-19b322d42b1f\cvs2svn_lib\pass_manager.py", line 181, in run
      the_pass.run(run_options, stats_keeper)
    File "c:\Portable progs\cvs2svn-19b322d42b1f\cvs2svn_lib\passes.py", line 1771, in run
      svn_commit.output(Ctx().output_option)
    File "c:\Portable progs\cvs2svn-19b322d42b1f\cvs2svn_lib\svn_commit.py", line 238, in output
      output_option.process_primary_commit(self)
    File "c:\Portable progs\cvs2svn-19b322d42b1f\cvs2svn_lib\hg_output_option.py", line 291, in process_primary_commit
      svn_commit, [parent1, parent2], filenames, getfilectx, lod)
    File "c:\Portable progs\cvs2svn-19b322d42b1f\cvs2svn_lib\hg_output_option.py", line 715, in _commit_primary
      return self._commit(svn_commit, parents, filenames, getfilectx, lod)
    File "c:\Portable progs\cvs2svn-19b322d42b1f\cvs2svn_lib\hg_output_option.py", line 733, in _commit
      return self._commit_memctx(mctx)
    File "c:\Portable progs\cvs2svn-19b322d42b1f\cvs2svn_lib\hg_output_option.py", line 739, in _commit_memctx
      node = self.repo.commitctx(mctx)
    File "mercurial\localrepo.pyo", line 63, in wrapper
    File "mercurial\localrepo.pyo", line 1399, in commitctx
    File "mercurial\localrepo.pyo", line 1193, in _filecommit
    File "mercurial\filelog.pyo", line 76, in cmp
  AttributeError: 'bool' object has no attribute 'startswith'
  </code></pre>
  
  <h2>Tailor, fromcvs</h2>
  
  <p>Initially blocked by link rot, but after Googling a lot, turn out to be Linux-only tools (?). I do have cygwin but I never had any good experiences compiling source distributions.</p>
  
  <h2>hg-cvs-import</h2>
  
  <p>Link rot too, and can't find anything. Moreover about the last three tools, I read on <a href="https://stackoverflow.com/questions/5153122/would-you-migrate-from-cvs-to-svn-or-directly-to-git-or-hg">Would you migrate from cvs to svn or directly to git or hg?</a>: "The Tailor extension, hg-cvs-import, fromcvs seems to be old code and aren't maintained any more."</p>
  
  <hr>
  
  <p>I also tried the trick on <a href="https://stackoverflow.com/questions/4131690/convert-cvs-to-mercurial">Convert cvs to mercurial</a>, even though it probably only retains local file history, but got the same result as in my first try.</p>
  
  <p>Any other tools I somehow missed? Maybe a user-friendly application for Windows?</p>