0
votes

I want to convert a mercurial repository into subversion (I know, I know) but the standard answer for this Converting from Mercurial to Subversion doesn't seem to work for me. I have installed tortoiseHg and the svn command line package from collabnet. Any ideas or tips?

D:\work\horizon>hg convert --dest-type svn src horizon-svn --debug --traceback
initializing svn repository 'horizon-svn'
running: "svnadmin" "create" "D:\work\horizon\horizon-svn" < NUL:
Traceback (most recent call last):
  File "mercurial\dispatch.pyo", line 87, in _runcatch
  File "mercurial\dispatch.pyo", line 696, in _dispatch
  File "mercurial\dispatch.pyo", line 472, in runcommand
  File "mercurial\extensions.pyo", line 184, in wrap
  File "hgext\color.pyo", line 362, in colorcmd
  File "mercurial\dispatch.pyo", line 786, in _runcommand
  File "mercurial\dispatch.pyo", line 757, in checkargs
  File "mercurial\dispatch.pyo", line 693, in <lambda>
  File "mercurial\util.pyo", line 463, in check
  File "hgext\convert\__init__.pyo", line 269, in convert
  File "hgext\convert\convcmd.pyo", line 439, in convert
  File "hgext\convert\convcmd.pyo", line 70, in convertsink
  File "hgext\convert\subversion.pyo", line 1027, in __init__
  File "hgext\convert\common.pyo", line 322, in run0
  File "hgext\convert\common.pyo", line 318, in checkexit
Abort: svnadmin exited with status 1
abort: svnadmin exited with status 1

And here is the version information:

D:\test\Horizon>hg version
Mercurial Distributed SCM (version 2.2.3)
(see http://mercurial.selenic.com for more information)

Copyright (C) 2005-2012 Matt Mackall and others
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

D:\test\Horizon>

When I try the same on Ubuntu it also fails in a similar way.

mike@mike-virtual-machine ~/repos $ hg convert --dest-type svn ~/Horizon ~/HorizonToSvn -v --debug  --traceback > debug_convert.log
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/mercurial/dispatch.py", line 87, in _runcatch
    return _dispatch(req)
  File "/usr/lib/python2.7/dist-packages/mercurial/dispatch.py", line 684, in _dispatch
    cmdpats, cmdoptions)
  File "/usr/lib/python2.7/dist-packages/mercurial/dispatch.py", line 466, in runcommand
    ret = _runcommand(ui, options, cmd, d)
  File "/usr/lib/python2.7/dist-packages/mercurial/dispatch.py", line 738, in _runcommand
    return checkargs()
  File "/usr/lib/python2.7/dist-packages/mercurial/dispatch.py", line 692, in checkargs
    return cmdfunc()
  File "/usr/lib/python2.7/dist-packages/mercurial/dispatch.py", line 681, in <lambda>
    d = lambda: util.checksignature(func)(ui, *args, **cmdoptions)
  File "/usr/lib/python2.7/dist-packages/mercurial/util.py", line 458, in check
    return func(*args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/hgext/convert/__init__.py", line 269, in convert
    return convcmd.convert(ui, src, dest, revmapfile, **opts)
  File "/usr/lib/python2.7/dist-packages/hgext/convert/convcmd.py", line 445, in convert
    c.convert(sortmode)
  File "/usr/lib/python2.7/dist-packages/hgext/convert/convcmd.py", line 361, in convert
    self.copy(c)
  File "/usr/lib/python2.7/dist-packages/hgext/convert/convcmd.py", line 330, in copy
    source, self.map)
  File "/usr/lib/python2.7/dist-packages/hgext/convert/subversion.py", line 1144, in putcommit
    entries.update(self.add_dirs(files.difference(entries)))
  File "/usr/lib/python2.7/dist-packages/hgext/convert/subversion.py", line 1101, in add_dirs
    self.xargs(add_dirs, 'add', non_recursive=True, quiet=True)
  File "/usr/lib/python2.7/dist-packages/hgext/convert/common.py", line 366, in xargs
    self.run0(cmd, *(list(args) + l), **kwargs)
  File "/usr/lib/python2.7/dist-packages/hgext/convert/common.py", line 317, in run0
    self.checkexit(status, output)
  File "/usr/lib/python2.7/dist-packages/hgext/convert/common.py", line 313, in checkexit
    raise util.Abort('%s %s' % (self.command, msg))
Abort: svn exited with status 32512
abort: svn exited with status 32512
mike@mike-virtual-machine ~/repos $
1
hg version please and, just for sake, check hg glogLazy Badger
You could try to do the conversion in an Ubuntu virtual machine, maybe it works there. Also, you should file a bug report in the Mercurial bug tracking system, cause this looks like a bug to me. (Obviously not a very often-tested area of code.)Laurens Holst
Actually I see the same error on ubuntu mike@mike-virtual-machine ~ $ uname -a Linux mike-virtual-machine 3.2.0-23-generic #36-Ubuntu SMP Tue Apr 10 20:39:51 UTC 2012 x86_64 x86_64 x86_64 GNU/Linux mike@mike-virtual-machine ~ $ hg version Mercurial Distributed SCM (version 2.0.2) (see mercurial.selenic.com for more information) Copyright (C) 2005-2011 Matt Mackall and others This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. mike@mike-virtual-machine ~ $mikelong

1 Answers

0
votes

Standard answer to today's situation, I suppose, must be "Use hgsubversion for ineraction"

Extended version:

  • You must transform Mercurial DAG into applicable for Subversion linear history before push
  • You can create empty SVN-repo as future push-target or (for existing SVN-source), clone SVN-repo into additional repo, pull from it your repo, merge, push
  • For pushing into empty repo authormap and branchmap maybe have to be prepared by hand