SVN 支持历史合并,那么 Mercurial 有何优势?
可能的重复:
合并:hg/git 与 svn
你好,
我是 SVN 的长期用户并且已经听到了很多关于一般的善变和去中心化版本控制系统的争论。我知道的主要吹捧功能是 Mercurial 中的合并要容易得多,因为它记录每个合并的信息,因此每个连续的合并都知道以前的合并。
现在正如 红皮书 中所述,在与合并有关的部分中,SVN 已经支持此功能合并信息。现在我还没有真正使用过这个功能(虽然我想使用,但我们的 repo 版本还不够新),但是这个 SVN 功能与 Mercurial 提供的功能有什么特别不同吗?
对于那些不知道 svn 中历史合并的建议工作流程的人来说是这样的:
从开发主干分支到 做你自己的事情。
定期合并来自主干的更改 到您的分支以保持最新状态。
完成后合并回来 mergeinfo 以使过程顺利进行。
如果没有历史数据合并,这将是一场噩梦,因为比较严格地针对文件中的差异,并且没有考虑途中采取的步骤。因此,开发主干中的每次更改都会使您在合并回来时进一步陷入可能的冲突。
现在我想知道的是:
与 SVN 中的 mergeinfo 相比,使用 Mercurial 进行合并是否提供了显着的优势,或者这只是一堆空话?
有人使用过 SVN 中的 mergeinfo 功能吗?它在实践中到底有多好?
Possible Duplicate:
Merging: hg/git vs. svn
Hi,
I'm a long time SVN user and have been hearing a lot of brou ha ha with regard to mercurial and decentralised version control systems in general. The main touted feature that I am aware of is that merging in Mercurial is much easier because it records information for each merge so each successive merge is aware of the previous ones.
Now as stated in the red book, in the section to do with merging, SVN already supports this with mergeinfo. Now I have not actually used this feature (although I wanted to, our repo version wasn't recent enough) but is this SVN feature particularly different to what Mercurial offers?
For anyone who is not aware the suggested work flow for historical merging in svn is this:
branch from the development trunk to
do your own thing.Regularly merge changes from trunk
into your branch to stay up to date.Merge back when your done with the
mergeinfo to smooth the process.
Without historical data merging this is a nightmare because the comparison is strictly on the differences in the files and does not take into account the steps taken on the way. So each change in the development trunk puts you further into possible conflict when you merge back.
Now what I would like to know is:
Does merging using Mercurial provide a significant advantage when compared with mergeinfo in SVN or is this just a lot of hot air about nothing?
Has anyone used the mergeinfo feature in SVN and how good is it actually in practice?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
正如评论中提到的,这个 SO 问题几乎概括了它,但值得指出确切的 Subversion(最新的 1.6!)文档,说明合并限制:
什么?如果自上次合并回主干后您在该分支上做了更多工作,您就不能再进行第二次
--reintegrate
合并?您必须创建另一个分支或使用 一种精挑细选的语法,还有另一个选项来保持它的活力。
结论告诉您所需的一切知道:
让我们将其与 DVCS 进行比较:
只需合并即可;)
这并不意味着 SVN 不知道如何合并(对于简单的合并工作流程,它会完成这项工作),但其底层机制的复杂性实际上会限制分支和合并的使用,使得少数合并变得相当微不足道。
相比之下,DVCS中合并操作的便利性会增加分支的使用和合并场景的复杂性,而这些都不再是问题。
As mentioned in the comments, this SO question pretty much sums it up, but it bears pointing out the exact Subversion (1.6 latest!) documentation stating the merge limitation:
What? If you did work some more on that branch since the last merge back to trunk, you can no longer make a second
--reintegrate
merge?You have to create another branch or use a cherry-picking syntax with yet another option to keep it alive.
The conclusion tells you all you need to know:
Let's compare that to a DVCS:
Just merge already ;)
That doesn't mean SVN doesn't know how to merge (for simple merge workflow, it will do the job), but the complexity of its underlying mechanism will restrain in effect the usage of branches and merges, making the few merge left fairly trivial.
By contrast, the ease of merging operations in DVCS will increase the usage of branches and the complexity of merge scenario, which are no longer a problem.