【问题标题】:Convert CVS to Hg on Windows在 Windows 上将 CVS 转换为 Hg
【发布时间】:2014-10-27 14:48:41
【问题描述】:

我正在尝试将我们公司的 CVS 转换为 Mercurial,但到目前为止没有成功。应保留远程文件历史记录。

我试过RepositoryConversion - Mercurial上描述的转换工具

转换扩展

e:\Hg>hg convert -s CVS H:\Cvs
assuming destination cvs-hg
initializing destination cvs-hg repository
abort: CVS: invalid source repository type

发生了什么事!?

cvs2hg

看起来很有希望,但在最后一刻出错了。

python cvs2hg -v --encoding=UTF8 --hgrepos=e:/Hg h:/Cvs

10 分钟 9 英里文本后的结果:

----- 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 <module>
    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'

裁缝,来自cvs

最初被链接腐烂阻止,但在谷歌上搜索了很多之后,结果证明是仅限 Linux 的工具(?)。我确实有 cygwin,但我从来没有任何编译源代码分发的好经验。

hg-cvs-import

链接也坏了,找不到任何东西。此外,关于最后三个工具,我在Would you migrate from cvs to svn or directly to git or hg? 上读到:“Tailor 扩展、hg-cvs-import、fromcvs 似乎是旧代码,不再维护。”


我也在Convert cvs to mercurial 上尝试了这个技巧,尽管它可能只保留本地文件历史记录,但得到的结果与我第一次尝试时相同。

我错过了任何其他工具吗?也许是一个用户友好的 Windows 应用程序?

【问题讨论】:

  • 你用的是什么版本的hg?回滚到与您正在使用的工具一致的当前版本可能是有意义的。
  • H:\Cvs 是 CVS 的工作目录,是新鲜结帐吗?
  • 水银 3.1.1。刚看到一个新版本,现在测试一下。 H:\Cvs 是服务器存储库,而不是结帐。
  • 同样的结果。知道脚本是否需要特定的旧版 Hg 吗? (按日期,我​​猜是 1.8.1)
  • 阅读关于转换扩展要求小心!!! CVS 代码的来源必须是 1) CVS-checkout 2) 由您在转换时拥有的相同版本的 CVS CLI 工具执行。 RTFM!!!

标签: mercurial cvs


【解决方案1】:

我成功使用了 cvs2hgMercurial 2.0 源代码(不是较新的版本)

  • 下载 Mercurial 2.0 源代码,
  • Mercurial文件夹(位于Mercurial-2.0文件夹内)复制到cvs2svn文件夹,
  • 进入cvs2svn/Mercurial/pure
  • 复制内容到cvs2svn/Mercurial
  • 执行python cvs2hg

【讨论】:

  • 它必须是 2.0 版。用最新版本(3.x)试过了,还是不行……
猜你喜欢
  • 2012-03-07
  • 1970-01-01
  • 2011-03-17
  • 1970-01-01
  • 1970-01-01
  • 2010-10-25
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多