SVN 支持历史 merge ,那么 Mercurial 有哪些优势呢?

标签 svn mercurial workflow merge

<分区>

Possible Duplicate:
Merging: hg/git vs. svn

你好,

我是 SVN 的长期用户,并且听到了很多关于 Mercurial 和分散式版本控制系统的争论。我知道的主要吹捧功能是在 Mercurial 中 merge 要容易得多,因为它记录了每次 merge 的信息,因此每次后续 merge 都知道之前的 merge 。

现在如 red book 中所述,在与 merge 有关的部分中,SVN 已经通过 mergeinfo 支持这一点。现在我还没有真正使用过这个功能(虽然我想用,但我们的 repo 版本不够新)但是这个 SVN 功能与 Mercurial 提供的功能有什么特别不同吗?

对于任何不知道 svn 中历史 merge 的建议工作流程的人是这样的:

  1. 从开发主干分支到 做你自己的事。

  2. 定期 merge 主干中的更改 进入您的分支机构以了解最新信息。

  3. 完成后 merge 回来 mergeinfo 以平滑该过程。

如果不 merge 历史数据,这将是一场噩梦,因为比较严格地基于文件的差异,而没有考虑途中采取的步骤。因此,当您 merge 回来时,开发主干中的每个更改都会使您进一步陷入可能的冲突。

现在我想知道的是:

与 SVN 中的 mergeinfo 相比,使用 Mercurial 进行 merge 是否提供了显着的优势,或者这只是空谈而已?

有没有人用过 SVN 中的 mergeinfo 功能,实际效果如何?

最佳答案

正如评论中提到的,这个 SO 问题几乎概括了它,但它指出了确切的 Subversion(最新 1.6!)文档说明 merge 限制:

    svn merge --reintegrate ^/branches/my-calc-branc

once a --reintegrate merge is done from branch to trunk, the branch is no longer usable for further work. It's not able to correctly absorb new trunk changes, nor can it be properly reintegrated to trunk again.

什么?如果自上次 merge 回主干后您在该分支上做了更多工作,您不能再进行第二次 --reintegrate merge?
您必须创建另一个分支或使用 a cherry-picking syntax with yet保持它存活的另一种选择。

结论告诉你所有你需要知道的:

The bottom line is that Subversion's merge-tracking feature has an extremely complex internal implementation, and the svn:mergeinfo property is the only window the user has into the machinery. Because the feature is relatively new, a numbers of edge cases and possible unexpected behaviors may pop up.

For example, sometimes mergeinfo will be generated when running a simple svn copy or svn move command.

  • Sometimes mergeinfo will appear on files that you didn't expect to be touched by an operation.
  • Sometimes mergeinfo won't be generated at all, when you expect it to.

Furthermore, the management of mergeinfo metadata has:

  • a whole set of taxonomies and behaviors around it, such as “explicit” versus “implicit” mergeinfo, “operative” versus “inoperative” revisions,
  • specific mechanisms of mergeinfo “elision,”
  • and even “inheritance” from parent to child directories.

让我们将其与 DVCS 进行比较:

已经 merge ​​;)

这并不意味着 SVN 不知道如何 merge (对于简单的 merge workflow ,它会完成这项工作),但其底层机制的复杂性实际上会限制分支和 merge 的使用,使得少数 merge 变得相当微不足道。
相比之下,DVCS中 merge 操作的简便性会增加分支的使用和 merge 场景的复杂性,这些都不再是问题。

关于SVN 支持历史 merge ,那么 Mercurial 有哪些优势呢?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2886865/

相关文章:

version-control - 重新应用已取消的祖先更改

java - SVN、Eclipse 和 Java

mercurial - 协调多个依赖的 mercurial 存储库版本的推荐方法?

linux - svn 提交失败 : Details Follow Directory . .. 丢失

mercurial - 如何让已删除的文件在 Mercurial 中保持不被跟踪?

workflow - Workflow Foundation(.NET) 等效于 Python、Java、C++?

sql - 如何管理同一记录的多个版本

workflow - 用于自定义 TFS Build 2010 的资源

svn - SSL 握手失败 SVN(无 SSL 证书)

windows - SVN 无法提交 svn 不要求用户名密码