在Windows7 64位和Ubuntu上将mercurial存储库转换为subversion的问题

时间:2012-11-27 01:54:27

标签: svn mercurial mercurial-extension

我想将一个mercurial存储库转换为subversion(我知道,我知道),但这个Converting from Mercurial to Subversion的标准答案对我来说似乎不起作用。我已经从collabnet安装了tortoiseHg和svn命令行包。任何想法或提示?

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

以下是版本信息:

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>

当我在Ubuntu上尝试相同时,它也会以类似的方式失败。

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 个答案:

答案 0 :(得分:0)

今天的情况的标准答案,我想,必须是“使用hgsubversion进行不当行为”

扩展版本:

  • 必须将Mercurial DAG转换为适用于Subversion线性历史记录才能推送
  • 您可以创建空的SVN-repo作为未来的推送目标(对于现有的SVN源),将SVN-repo克隆到其他仓库中,从中提取您的仓库,合并,推送
  • 推送到空的repo authormap和branchmap可能需要手工准备