简体   繁体   English

你会从 cvs 迁移到 svn 还是直接迁移到 git 或 hg?

[英]Would you migrate from cvs to svn or directly to git or hg?

I don't know if this is the right forum to ask.我不知道这是否是合适的论坛提问。

My company makes use of CVS as a version control system.我的公司使用 CVS 作为版本控制系统。 We plan to move to a more modern version control system.我们计划转向更现代的版本控制系统。 What would you recommend as the least risky solution?您会推荐什么作为风险最低的解决方案?

My idea is to use Subversion but I also hear a lot of good things about Git and Mercurial我的想法是使用 Subversion 但我也听到了很多关于 Git 和 Mercurial 的好消息

However, we are a small company and we don't need a distributed version control system.但是,我们是一家小公司,我们不需要分布式版本控制系统。 What advantages do Git or Mercurial have with respect to Subversion, besides the fact that they are distributed?除了分布式之外,Git 或 Mercurial 相对于 Subversion 有什么优势?

We migrated from CVS to Mercurial about 2 weeks ago at my job.大约 2 周前,我们在我的工作中从 CVS 迁移到 Mercurial。 We are a small team of 6 people.我们是一个6人的小团队。 Only two of us had already worked with something other than CVS prior to the migration.在迁移之前,我们中只有两个人已经使用过 CVS 以外的东西。

I was in charge for the choice of the new CVS.我负责选择新的 CVS。 I considered Git and Mercurial.我考虑过 Git 和 Mercurial。

Some of the griefs we've had with CVS were poor branching possibilities, no support for renaming, really bad algorithm for conflicts.我们在使用 CVS 时遇到的一些问题是分支可能性很差,不支持重命名,冲突算法非常糟糕。

I never considered SVN because, each time I tried to use it with branches in the past, merges were always a headache.我从来没有考虑过 SVN,因为过去每次我尝试将它与分支一起使用时,合并总是令人头疼。 And frankly, all the hype is for dvcs these days, and there must be a reason about it ;)坦率地说,这些天所有的炒作都是针对 dvcs 的,这肯定是有原因的;)

Between Git and Mercurial, it's really more about personal choice.在 Git 和 Mercurial 之间,更多的是个人选择。 My heart fell for Mercurial because I've found it easier to learn than Git and less "really big project" oriented.我为 Mercurial 倾倒,因为我发现它比 Git 更容易学习,而且不太面向“真正的大项目”。

Advantages of Git / Mercurial over SVN Git / Mercurial 相对于 SVN 的优势

  1. Better branches and merging capabilities (really the most important reason)更好的分支和合并能力(真的是最重要的原因)
  2. Possibilities to export / import patch in bundles, via e-mail, etc可以通过电子邮件等方式导出/导入补丁包
  3. Didn't do extensive tests about that, but I think both are faster in many ways than SVN (merging, cloning, diffing, etc)没有对此进行广泛的测试,但我认为两者在很多方面都比 SVN(合并、克隆、差异化等)
  4. Development is much more active, I heard the SVN team is trying to move forward, but still.开发更加活跃,我听说 SVN 团队正在努力向前发展,但仍然如此。
  5. Really good extensions infrastructure非常好的扩展基础设施
  6. Shipped web server capability, really useful for quickly sharing something for example.提供网络服务器功能,例如对于快速共享某些内容非常有用。

And even if you said "besides the fact that they are distributed", I think this is really a killer feature.即使你说“除了它们是分布式的”,我认为这确实是一个杀手级功能。 DVCS allows some really neat things, it may not seem useful at the beginning, but once you've used them, you can't do without them ;) DVCS 允许一些非常简洁的东西,一开始它可能看起来没什么用,但是一旦你用过它们,你就离不开它们 ;)

Learning curve学习曲线

Two people on the team weren't really happy about the change.团队中有两个人对这种变化并不满意。 But with a little two hour explanation for the whole team with some slides, everything went smoothly.但是通过一些幻灯片对整个团队进行了两个小时的解释,一切都很顺利。

Sure, they ask me questions sometimes, but we haven't had any real problems since the migration.当然,他们有时会问我问题,但自迁移以来我们没有遇到任何真正的问题。 Just some little misunderstandings about the way to merge pulled changes in the working directory.只是关于在工作目录中合并拉取更改的方式的一些小误解。 Nothing which wasn't resolved in a matter of minutes.没有在几分钟内解决不了的事情。

I think I can say that in just about 2 weeks, everyone is at least as productive as before and confident with the new tool.我想我可以说,在短短大约 2 周内,每个人都至少像以前一样高效,并对新工具充满信心。 And now we can use features branches without fear of the merge to come :)现在我们可以使用功能分支而不必担心合并:)

Migrating CVS to mercurial将 CVS 迁移到 mercurial

https://www.mercurial-scm.org/wiki/RepositoryConversion#CVS https://www.mercurial-scm.org/wiki/RepositoryConversion#CVS

Different methods are listed on the official wiki about migrating from CVS to Mercurial.关于从 CVS 迁移到 Mercurial,官方 wiki 上列出了不同的方法。 I tested the Convert extension and cvs2hg which was finally used.我测试了最终使用的 Convert 扩展和 cvs2hg。

The Tailor extension, hg-cvs-import, from CVS seems to be old code and not maintained any more.来自 CVS 的 Tailor 扩展 hg-cvs-import 似乎是旧代码,不再维护。

The Convert extension works just fine on a simple repository, but since our CVS repository was really big and had some really strange branches, the extension wasn't able to import correctly all of the history. Convert 扩展在一个简单的存储库上工作得很好,但是由于我们的 CVS 存储库非常大并且有一些非常奇怪的分支,扩展无法正确导入所有历史记录。 The HEAD was correct, but some branches were missing. HEAD 是正确的,但缺少一些分支。

So, the last choice is cvs2hg .所以,最后的选择是cvs2hg In fact it is a new backend for cvs2svn, which converts to Mercurial instead of Subersion.事实上,它是 cvs2svn 的一个新后端,它转换为 Mercurial 而不是 Subersion。

The 'Quick start' approach presented in the Readme worked out of the box with all the branches.自述文件中介绍的“快速启动”方法适用于所有分支。 But finally I used the option file to add some user mapping and prune some buggy commits or unwanted branches.但最后我使用选项文件添加了一些用户映射并修剪了一些有问题的提交或不需要的分支。

The option file in the provided with the files is well commented, it won't be hard for you to configure it to suit you.随文件提供的选项文件有很好的注释,配置它以适合您并不难。

For information, after the initial conversion, I used the Convert extension to do some subproject extraction from the resulting Mercurial repository to another Mercurial repository, like explained here .有关信息,在初始转换后,我使用 Convert 扩展将一些子项目从生成的 Mercurial 存储库提取到另一个 Mercurial 存储库,如解释here

Edit : Great Link - http://whygitisbetterthanx.com/编辑:很棒的链接 - http://whygitisbetterthanx.com/

========================================================== ================================================== ========

Yes, infact we have just moved from SVN to Mercurial.是的,事实上我们刚刚从 SVN 转移到 Mercurial。

Aside from the distributed side of things Mercurial and GIT are alot faster than SVN, and also the repo doesnt have annoying .SVN folders in ever folder.除了分布式方面,Mercurial 和 GIT 比 SVN 快很多,而且 repo 在 ever 文件夹中没有烦人的 .SVN 文件夹。 Not to mention the merge works alot better!更不用说合并效果更好了! The fact yuo can also store your repo on any shared drive is nice (No need to install stuff on the server, for Mercurial anyways)你还可以将你的 repo 存储在任何共享驱动器上这一事实很好(无需在服务器上安装东西,反正对于 Mercurial)

More reading更多阅读

Should I use SVN or Git?我应该使用 SVN 还是 Git?

http://www.richappsconsulting.com/blog/blog-detail/svn-vs-git-who-will-be-the-future-of-revision-control/ http://www.richappsconsulting.com/blog/blog-detail/svn-vs-git-who-will-be-the-future-of-revision-control/

http://thinkvitamin.com/code/why-you-should-switch-from-subversion-to-git/ http://thinkvitamin.com/code/why-you-should-switch-from-subversion-to-git/

http://techblog.floorplanner.com/2008/12/09/git-vs-svn-for-bosses/ http://techblog.floorplanner.com/2008/12/09/git-vs-svn-for-bosses/

And finally GIT Vs Mercurial最后是 GIT 与 Mercurial

http://gitvsmercurial.com/ - This site looks like it's dead now :( http://gitvsmercurial.com/ - 这个网站现在看起来已经死了:(

  1. Merging code and resolving conflicts is easier using a distributed VCS like GIT or Mercurial.使用分布式 VCS(如 GIT 或 Mercurial)更容易合并代码和解决冲突。 The reason is that GIT or mercurial have all the intermediate snapshots of the two "end codes" to be merged while subversion would only know the end snapshot unless each SVN user is working in his/her own branch.原因是 GIT 或 mercurial 具有要合并的两个“结束代码”的所有中间快照,而除非每个 SVN 用户都在他/她自己的分支中工作,否则 subversion 只会知道结束快照。

  2. With a distributed VCS, you are not dependent on the network to check code in.使用分布式 VCS,您无需依赖网络来签入代码。

  3. If you have a large number of users checking stuff into VCS on a daily basis, your SVN server better be very powerful to handle concurrent check-ins/outs.如果您每天有大量用户将内容签入 VCS,那么您的 SVN 服务器最好能够非常强大地处理并发签入/签出。 DVCSs dont have that problem. DVCS 没有这个问题。

We made our switch from CVS to SVN and now to Mercurial and we are very happy with the transition.我们从 CVS 切换到 SVN,现在又切换到 Mercurial,我们对转换感到非常满意。 There is nothing about SVN we are missing in Mercurial but going back to SVN would be painful.我们在 Mercurial 中没有遗漏任何关于 SVN 的东西,但是回到 SVN 会很痛苦。

Things SVN has that might be important to your workflow: SVN 具有的可能对您的工作流程很重要的东西:

  1. Partial checkouts.部分结帐。
    Can just checkout part of the tree (important if you have more than 1 project in your repository)可以只检出树的一部分(如果您的存储库中有 1 个以上的项目,这很重要)

  2. Mixed checkouts.混合结帐。
    Parts of your checkout can be at different revisions, down to a single file.结帐的某些部分可以有不同的修订版本,甚至可以是单个文件。

  3. Globally unique revision is monotonically increasing.全球唯一修订单调递增。
    It's easy to see in SVN that rev 1206 is later than 1100 (cf, is cfbb0827c67d later than d500c208c3c5?)在 SVN 中很容易看到 rev 1206 晚于 1100(参见,cfbb0827c67d 晚于 d500c208c3c5 吗?)

  4. Many projects can share the same SVN repository.许多项目可以共享同一个 SVN 存储库。
    If your package consists of several EXEs, DLLs and whatnot, in Hg/Git land you may end up using several repositories to manage this.如果您的包包含多个 EXE、DLL 等,在 Hg/Git 领域,您最终可能会使用多个存储库来管理它。 This can complicate tag/revision handling somewhat这可能会使标记/修订处理有些复杂

We (Nokia OVI maps) are also migrating from SVN to HG.我们(诺基亚 OVI 地图)也正在从 SVN 迁移到 HG。 The reason to choose HG over git is that HG is more userfriendly, the commands make much more sense compared to the sometimes obscure git commands.选择 HG 而不是 git 的原因是 HG 更加用户友好,与有时晦涩的 git 命令相比,这些命令更有意义。 Also for windows users mercurial works much better, and tortoiseHG is quite mature.同样对于 windows 用户来说,mercurial 的效果要好得多,而 tortoiseHG 已经相当成熟了。 When I was testing git on windows, I observed serious performance problems at some simple operations like checking for modifications...当我在 Windows 上测试 git 时,我在一些简单的操作(例如检查修改)中观察到严重的性能问题......

I really like also that you can use features that you want via extensions.我也很喜欢你可以通过扩展使用你想要的功能。 So the learning curve is smoother than with git, consider the cache area for example.所以学习曲线比使用 git 更平滑,例如考虑缓存区域。 For people coming from SVN I think HG is good option.对于来自 SVN 的人,我认为 HG 是不错的选择。

They should be more careful with the history for example, we are encouraging to do hg pull --rebase in order to have history as linear as possible and merge only branches.例如,他们应该对历史更加小心,我们鼓励执行 hg pull --rebase 以使历史尽可能线性并仅合并分支。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM