【问题标题】:Error "abort: unable to cope with svn output" converting Mercurial repository to SVN repository with "hg.exe convert" command使用“hg.exe convert”命令将 Mercurial 存储库转换为 SVN 存储库时出现错误“中止:无法处理 svn 输出”
【发布时间】:2021-10-03 15:36:56
【问题描述】:

场景

我正在尝试将 Mercurial 存储库转换为 SVN。 (我不打算永远将它留在 SVN 中。请相信我在 SVN 中确实需要它。我们最终会将其移至 Git,但不是今天。)

命令

cd into Hg working copy.
hg convert --source-type hg  --dest-type svn . ..\svn_repo_output_dir\

输出

它在完成之前中止:

unexpected svn output:
abort: unable to cope with svn output

有谁知道我如何找出“hg convert”命令一直在输出的 SVN 输出,以便我可以解决这个问题?

更新(添加调试信息)

使用三个新的 agruments(--verbose、--debug、--traceback),这里是命令:

hg convert **--verbose --debug --traceback** --source-type hg  --dest-type svn . ..\svn_layout7\

这是它的失败输出:

Committing transaction...
Committed revision 89.
running: svn propset hg:convert-rev 4e6d788ad9389d8b8740f1c69dd3b8c76afc9e29 --revprop "--revision=89"
svn: E165006: Repository has not been enabled to accept revision propchanges;
ask the administrator to create a pre-revprop-change hook
77 #2140: Fixed "APP_NOT_INSTALLED" error in case InDesign CS5.5 is installed
source: e634a2c46761335bc78a04d97908ef64792c1742
76 Merge
source: 1a6a7e9ae244ff9976a7d1b84ff9241ea76169d4
running: svn commit "--username=ALady" "--file=c:\users\my_username\appdata\local\temp\hg-convert-jvaadp" "--encoding=utf-8"
unexpected svn output:
run hg source post-conversion action
Traceback (most recent call last):
  File "mercurial\scmutil.pyo", line 165, in callcatch
  File "mercurial\dispatch.pyo", line 367, in _runcatchfunc
  File "mercurial\dispatch.pyo", line 1021, in _dispatch
  File "mercurial\dispatch.pyo", line 756, in runcommand
  File "mercurial\dispatch.pyo", line 1030, in _runcommand
  File "mercurial\dispatch.pyo", line 1018, in <lambda>
  File "mercurial\util.pyo", line 1670, in check
  File "hgext\convert\__init__.pyo", line 450, in convert
  File "hgext\convert\convcmd.pyo", line 616, in convert
  File "hgext\convert\convcmd.pyo", line 525, in convert
  File "hgext\convert\convcmd.pyo", line 492, in copy
  File "hgext\convert\subversion.pyo", line 1332, in putcommit
Abort: unable to cope with svn output
abort: unable to cope with svn output

【问题讨论】:

  • 不,它没有,@StayOnTarget。不过谢谢。每次提交都会显示该 propchange 消息,甚至可以很好地转换为 SVN 存储库格式的提交。创建该钩子会使消息消失,但问题并没有消失。我认为当我们遇到 TortoiseHg 列出更改的零文件的 Mercurial 合并时问题就来了。所以也许“提交而不更改任何文件”不是 hg convert 可以变成 SVN 存储库事务/事件/发生的东西。
  • 这是一个很好的理论。您可能会尝试制作一个具有类似提交的小型测试存储库,看看是否会重现该问题。这也将为您提供一个沙盒来尝试变通方法。 (我能想到的就是引入一些虚拟文件,这些文件在这些提交中总是有名义上的变化。如果这有效,您可以使用 histedit 将其引入您的真实存储库,尽管这样做可能会非常费力,具体取决于提交的数量你必须“修复”)
  • 实际上,甚至 histedit 也无济于事,因为我认为它不适用于合并提交。

标签: svn mercurial


【解决方案1】:

这不是一个精确的解决方案,但可能会帮助您找到一个。

我在他们推荐的地方发现了一个类似错误的report

来自hg help -v convert

  -v --verbose           enable additional output
     --debug             enable debugging output

以下内容可能有助于开发人员确定 处理失败:

--traceback         always print a traceback on exception

实际上,对于许多情况,这些都是很好的调试技巧。

(如果看起来相关,您可能想尝试这些选项并在问题中添加更多信息)。

【讨论】:

  • 谢谢,@StayOnTarget。我已经添加了这三个参数来运行命令,并使用输出更新了这篇文章。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多