problems converting from CVS to mercurial (via fastimport)

Thomas Klausner tk at giga.or.at
Sat Jun 6 20:18:04 UTC 2015


Hi!

I'm currently trying to convert the pkgsrc-wip CVS repository
(pkgsrc-wip.sf.net) to a mercurial repository.

I've been doing it by converting to fossil using cvs2fossil[1]
(http://www.sonnenberger.org/2014/05/02/bug-fix-update-cvs2fossil/)
and using fossil's export command to create a git fastimport stream
(~800MB), which I can successfully import into git. A checkout of
'trunk' then gives me the same state as a CVS checkout.

I've tried importing the same fastimport stream into mercurial using
the hg-fastimport extension, but it failed with:

Removing blob dir '/home/wiz/Projects/pkgsrc-wip-hg-repo/.hg/blobs' ...
** Unknown exception encountered with possibly-broken third-party extension fastimport
** which supports versions unknown of Mercurial.
** Please disable fastimport and try your action again.
** If that fixes the bug please report it to the extension author.
** Python 2.7.10 (default, May 28 2015, 21:57:01) [GCC 4.8.4]
** Mercurial Distributed SCM (version 3.4.1)
** Extensions loaded: convert, patchbomb, pager, color, fastimport
Traceback (most recent call last):
  File "/usr/pkg/bin/hg", line 43, in <module>
    mercurial.dispatch.run()
  File "/usr/pkg/lib/python2.7/site-packages/mercurial/dispatch.py", line 29, in run
    sys.exit((dispatch(request(sys.argv[1:])) or 0) & 255)
  File "/usr/pkg/lib/python2.7/site-packages/mercurial/dispatch.py", line 91, in dispatch
    ret = _runcatch(req)
  File "/usr/pkg/lib/python2.7/site-packages/mercurial/dispatch.py", line 160, in _runcatch
    return _dispatch(req)
  File "/usr/pkg/lib/python2.7/site-packages/mercurial/dispatch.py", line 885, in _dispatch
    cmdpats, cmdoptions)
  File "/usr/pkg/lib/python2.7/site-packages/mercurial/dispatch.py", line 646, in runcommand
    ret = _runcommand(ui, options, cmd, d)
  File "/usr/pkg/lib/python2.7/site-packages/mercurial/extensions.py", line 168, in closure
    return func(*(args + a), **kw)
  File "/usr/pkg/lib/python2.7/site-packages/hgext/color.py", line 521, in colorcmd
    return orig(ui_, opts, cmd, cmdfunc)
  File "/usr/pkg/lib/python2.7/site-packages/mercurial/extensions.py", line 168, in closure
    return func(*(args + a), **kw)
  File "/usr/pkg/lib/python2.7/site-packages/hgext/pager.py", line 160, in pagecmd
    return orig(ui, options, cmd, cmdfunc)
  File "/usr/pkg/lib/python2.7/site-packages/mercurial/dispatch.py", line 976, in _runcommand
    return checkargs()
  File "/usr/pkg/lib/python2.7/site-packages/mercurial/dispatch.py", line 947, in checkargs
    return cmdfunc()
  File "/usr/pkg/lib/python2.7/site-packages/mercurial/dispatch.py", line 882, in <lambda>
    d = lambda: util.checksignature(func)(ui, *args, **cmdoptions)
  File "/usr/pkg/lib/python2.7/site-packages/mercurial/util.py", line 716, in check
    return func(*args, **kwargs)
  File "/usr/pkg/lib/python2.7/site-packages/hgfastimport/__init__.py", line 46, in fastimport
    c.convert(sortmode)
  File "/usr/pkg/lib/python2.7/site-packages/hgext/convert/convcmd.py", line 439, in convert
    heads = self.source.getheads()
  File "/usr/pkg/lib/python2.7/site-packages/hgfastimport/hgimport.py", line 58, in getheads
    self._parse()
  File "/usr/pkg/lib/python2.7/site-packages/hgfastimport/hgimport.py", line 142, in _parse
    self.processor.process(p.iter_commands)
  File "/usr/pkg/lib/python2.7/site-packages/fastimport/processor.py", line 75, in process
    self._process(command_iter)
  File "/usr/pkg/lib/python2.7/site-packages/fastimport/processor.py", line 86, in _process
    handler(self, cmd)
  File "/usr/pkg/lib/python2.7/site-packages/hgfastimport/hgimport.py", line 317, in commit_handler
    commit_handler.process()
  File "/usr/pkg/lib/python2.7/site-packages/fastimport/processor.py", line 168, in process
    handler(self, fc)
  File "/usr/pkg/lib/python2.7/site-packages/fastimport/processor.py", line 201, in deleteall_handler
    raise NotImplementedError(self.deleteall_handler)
NotImplementedError: <bound method HgImportCommitHandler.deleteall_handler of <hgext_fastimport.hgimport.HgImportCommitHandler object at 0x7f7ff725b450>>


I've then tried converting the git repository to mercurial using 'hg
convert'; this works, but gives me two files that are CVS 'dead' in
the hg checkout, and diffs for two other files (compared to the CVS or
git checkouts). I'm not sure how to find out why these artifacts
happen, since they don't appear in git and look fine in CVS AFAICT.

Suggestions?
 Thomas

[1] cvs2fossil was especially adapted to handle NetBSD's src and
pkgsrc well, so I assumed it would be the least painful way for
pkgsrc-wip too.


More information about the Mercurial mailing list