与 CVS 相比,使用 SVN 有何优点?

发布于 2024-07-04 14:59:22 字数 159 浏览 5 评论 0 原文

我的公司正在使用 CVS 作为我们事实上的源代码控制标准。 不过,我听很多人说SVN更好。

我知道 SVN 比较新,但除此之外,我不熟悉它的好处。

我正在寻找的是对两个系统进行良好、简洁的比较,指出每个系统在 Java/Eclipse 开发环境中的优点或缺点。

My company is using CVS as our de-facto standard for source control. However, I've heard a lot of people say that SVN is better.

I know SVN is newer, but other than that, I'm unfamiliar with its benefits.

What I'm looking for is a good, succinct comparison of the two systems, noting any advantages or disadvantages of each in a Java/Eclipse development environment.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(12

段念尘 2024-07-11 14:59:22

众多比较之一:

http://wiki.scummvm.org/index.php/CVS_vs_SVN

现在,这是针对该项目的,但很多内容都适用。

专业颠覆:

  • 支持版本化重命名/移动(CVS 不可能):Fingolfin、Ender
  • 原生支持目录:可以删除它们,并且它们有版本控制:Fingolfin、Ender
  • 文件属性有版本控制; 不再有“可执行位”地狱:Fingolfin
  • 总体修订号使构建版本控制和回归测试变得更加容易:Ender、Fingolfin
  • 原子提交:Fingolfin
  • 直观(基于目录)的分支和标记:Fingolfin
  • 更简单的挂钩脚本(提交前/提交后等):SumthinWicked(我在提交后将其用于 Doxygen)
  • 防止意外提交冲突文件:Salty-horse、Fingolfin
  • 支持自定义“diff”命令:Fingolfin
  • 离线差异,而且是即时的:sev

One of the many comparisons:

http://wiki.scummvm.org/index.php/CVS_vs_SVN

Now this is very specific to that project, but a lot of stuff apllies in general.

Pro Subversion:

  • Support for versioned renames/moves (impossible with CVS): Fingolfin, Ender
  • Supports directories natively: It's possible to remove them, and they are versioned: Fingolfin, Ender
  • File properties are versioned; no more "executable bit" hell: Fingolfin
  • Overall revision number makes build versioning and regression testing much easier: Ender, Fingolfin
  • Atomic commits: Fingolfin
  • Intuitive (directory-based) branching and tagging: Fingolfin
  • Easier hook scripts (pre/post commit, etc): SumthinWicked (I use it for Doxygen after commits)
  • Prevents accidental committing of conflicted files: Salty-horse, Fingolfin
  • Support for custom 'diff' command: Fingolfin
  • Offline diffs, and they're instant: sev
傲影 2024-07-11 14:59:22

CVS 仅跟踪逐个文件的修改,而 SVN 将整个提交作为新修订进行跟踪,这意味着更容易跟踪项目的历史记录。 再加上所有现代源代码控制软件都使用修订概念的事实,因此从 SVN 迁移比从 CVS 迁移要容易得多。

还有原子提交问题。 虽然我只遇到过一次,但两个人在 CVS 中一起提交可能会相互冲突,从而丢失一些数据并使您的客户端处于不一致的状态。 如果及早发现,这些问题并不重要,因为您的数据仍然在某个地方,但在压力大的环境中可能会很痛苦。

最后,围绕 CVS 开发的工具已经不多了。 虽然像 Git 或 Mercurial 这样的全新工具肯定还缺乏工具,但 SVN 在任何系统上都有相当大的应用程序基础。

编辑 2020:说真的,这个答案已经有 12 年历史了。 忘记 SVN,像其他人一样使用 Git!

CVS only tracks modification on a file-by-file basis, while SVN tracks a whole commit as a new revision, which means that it is easier to follow the history of your project. Add the fact that all modern source control software use the concept of revision so it is far easier to migrate from SVN than it is from CVS.

There is also the atomic commit problem. While I only encountered it once, it is possible that 2 people committing together in CVS can conflict each other, losing some data and putting your client in an inconsistent state. When detected early, these problems are not major because your data is still out there somewhere, but it can be a pain in a stressful environment.

And finally, not many tools are developed around CVS anymore. While the new and shiny-new tools like Git or Mercurial definitely lack tools yet, SVN has a pretty large application base on any system.

EDIT 2020: Seriously, this answer is 12 years old now. Forget SVN, go use Git like everyone else!

给妤﹃绝世温柔 2024-07-11 14:59:22

作为一个正在 CVS 和 SVN 之间切换的人(最初我们用 cvs2svn 切换了所有项目,然后决定在新项目上只使用 svn 进行过渡),以下是我们遇到的一些问题。

  • 合并和分支非常不同,如果您频繁分支和合并,除非您的服务器上运行着 SVN 1.5,否则必须知道您何时分支(这在 Tortoise SVN 对话框中不是很清楚)。 Michael 说分支和合并很直观,但我认为在使用 CVS 10 年之后,事实并非如此。
  • 如果您在 Linux 上运行 SVN 服务器,则可能很难让您的 SA 迁移到 svn 1.5,因为默认安装为 1.4.x。
  • 在 TortoiseSVN 中合并冲突并不像在 TortoiseCVS 中那样容易或清晰(至少对我和我的同事来说)。 三窗格方法需要一些时间来适应,而 WinMerge(我首选的合并工具)不会进行三窗格合并。
  • 注意:我读过的许多在线教程和杂志文章显然不会分支和合并,您应该将主存储库设置为 https://svn.yoursvnserver.com/repos/YourProject/Trunkhttps://svn.yoursvnserver.com/repos/YourProject/Branches/BranchX 。 如果您在错误的位置启动存储库,您可以进行清理,但这会导致混乱。

As someone who is in the middle of switching between CVS and SVN (initially we switched all of our projects with cvs2svn and then decided that we would transition by only using svn on new projects), here are some of the problems we have had.

  • Merging and branching are very different, and if you branch and merge frequently, unless you have SVN 1.5 running on your server have to know when you branched (this isn't very clear in the Tortoise SVN dialogs). Michael says the branching and merging is intuitive, I would argue that after using CVS for 10 years, it is not.
  • If your are running the SVN server on Linux, it may be hard to get your SA to move to svn 1.5, as the default install 1.4.x.
  • Merging conflicts is not nearly as easy or as clear (at least to me and my co-workers) in TortoiseSVN as it is in TortoiseCVS. The three pane approach takes some getting used to and the WinMerge (my preferred merge tool) doesn't do a three pane merge.
  • Beware: many of the online tutorials and magazine articles I have read obviously don't branch and merge, you should set up your main repository as https://svn.yoursvnserver.com/repos/YourProject/Trunk and branches on https://svn.yoursvnserver.com/repos/YourProject/Branches/BranchX . You can clean up if you start your repos in the wrong place, but it leads to confusion.
一桥轻雨一伞开 2024-07-11 14:59:22

不可忽视的一件事是生态系统。 我当时在一家 CVSNT 商店工作,我发现越来越多的开源工具默认支持 SubVersion。

One thing not to overlook is ecosystem. I was working at a CVSNT shop, and I was finding more and more open source tools supported SubVersion by default.

平安喜乐 2024-07-11 14:59:22

CVS(并发版本系统)和 SVN(子版本)是两个版本控制文件系统,在单个项目上协作的团队普遍使用。 这些系统允许协作者跟踪所做的更改,并知道谁在开发哪个分支以及是否应将分支应用于主干。 CVS 是两者中较老的一个,它已成为很多人的标准协作工具。 SVN 较新,它引入了许多改进来满足大多数人的需求。

CVS (Concurrent Versions System) and SVN (SubVersioN) are two version control file systems that are popularly used by teams who are collaborating on a single project. These systems allow the collaborators to keep track of the changes that are made and know who is developing which and whether a branch should be applied to the main trunk or not. CVS is the much older of the two and it has been the standard collaboration tool for a lot of people. SVN is much newer and it introduces a lot of improvements to address the demands of most people.

辞别 2024-07-11 14:59:22

您应该查看 Git 而不是 SVN。 它是速度极快且功能强大的 DVCS。 它不像 SVN 那样用户友好,但它在这方面正在改进,并且学习起来并不难。

You should take a look at Git instead of SVN. It's a DVCS that's blazing-fast and very powerful. It's not as user-friendly as SVN, but it's improving in that regard, and it's not that hard to learn.

望她远 2024-07-11 14:59:22

嗯,我觉得有一些东西让 svn 很棒。

  1. SVN-Altassian 坩埚组合是一种更优越的审查和质量检查方法
  2. 更好地管理冲突和合并
  3. 进行签出、执行提交等显然更快。
  4. 原子提交问题 - 两个人在 CVS 中一起提交可能可以相互冲突,丢失一些数据并使您的代码库处于不一致的状态

使用 cvs2svn 可以在几个小时内轻松完成迁移。

Well, a few things which i feel makes svn awesome.

  1. The SVN-Altassian crucible combination is a far superior method of reviews and quality checks
  2. Better management of conflicts and merges
  3. It's obviously faster for taking checkouts, performing commits, etc.
  4. The atomic commit problem - It is possible that 2 people committing together in CVS can conflict each other, losing some data and putting your code base in an inconsistent state

Migration can easily be done in a few hours using cvs2svn.

奢欲 2024-07-11 14:59:22

您还可以选择仅将最新代码从 CVS 迁移到 SVN 并冻结当前的 CVS 存储库。 这将使迁移变得更容易,并且您还可以在旧的 CVS 存储库中构建旧版本。

you might also choose to migrate only the latest code from CVS into SVN and freeze your current CVS repo. this will make migration easier and you might also build your legacy releases in the old CVS repo.

酒废 2024-07-11 14:59:22

顺便说一句:CVSNT 支持原子提交

btw: CVSNT supports atomic commits

凌乱心跳 2024-07-11 14:59:22

我会赞同 Eridius 对 Git 的建议,但我会将其扩展到其他 DRCS(分布式修订控制系统),例如 Mercurialbazaar

这些产品是相当新的产品,目前它们的工具和集成水平似乎很低(基于我的初步研究)。 我想说它们最适合那里的电力开发人员(以及这里;-))。

另一方面,CVS 目前不能为您做什么? 从你最初的问题来看,你真的没有任何问题,“CVS 在这方面很糟糕,我可以用什么来代替?”

您必须权衡任何潜在迁移的成本和收益。 对于现有的项目,我认为很难证明其合理性。

I'll second Eridius' suggestion of Git, but I'd expand it to the other DRCS (Distributed Revision Control System) such as Mercurial and bazaar.

These products are fairly recent and the level of tooling and integration with them seems low at the moment (based on my initial research). I'd say they were best suited to the power-developers out there (and on here ;-)).

On the other hand, what doesn't CVS currently do for you? From your initial question, you don't really have any, "CVS sucks at this, what could I use instead?"

You've gotta weigh up the costs of any potential migration against the benefits. For an existing project, I think that it would be hard to justify.

淡水深流 2024-07-11 14:59:22

Subversion 书有附录,详细说明了与 CVS 的重要区别,这可能会帮助您做出决定。 这两种方法或多或少是相同的想法,但 SVN 是专门为修复 CVS 中长期存在的缺陷而设计的,因此,至少在理论上,SVN 永远是更好的选择。

The Subversion book has an appendix that details important differences from CVS, which may help you make your decision. The two approaches are more or less the same idea but SVN was specifically designed to fix long standing flaws in CVS so, in theory at least, SVN will always be the better choice.

祁梦 2024-07-11 14:59:22

SVN 与 CVS 相比有 3 个主要优点,

  • 速度更快,
  • 支持二进制文件的版本控制
  • 并添加事务提交(全部或全无)

SVN has 3 main advantages over CVS

  • it's faster
  • supports versioning of binary files
  • and adds transactional commit (all or nothing)
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文