SVN 修改文件上的 svn:mergeinfo 属性而没有更改 [英] SVN modifies svn:mergeinfo property on files with no change

查看:68
本文介绍了SVN 修改文件上的 svn:mergeinfo 属性而没有更改的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在使用 svn 时遇到问题"我不明白为什么有时当我合并两个分支时,它会报告修改了文件的 mergeinfo 属性,而文本没有更改.
这是正常行为吗?
如果没有,可能是什么问题?

I've a "problem" with svn I can't understand why sometimes when I merge two branches it reports modify on mergeinfo property on files with no changes on the text.
Is it a normal behavior?
If not, what can be the problem?

推荐答案

好吧,您确实合并了这两个分支.对?按预期工作.

Well, you did merge those two branches. Right? Works as expected.

你所做的是合并.即使合并不会导致任何代码更改,并且这在合并中并不少见,Subversion 仍会标记合并已完成.如果不出意外,标记您进行了合并——即使它没有导致任何更改,仍然是一个好主意.想象一下发布了一个版本,有人说等等,没有人将该分支合并回主干!我们将不得不推迟发布,直到我们完成它",因为他们没有看到在 svn:merge-info 记录中合并.

What you did was do a merge. Even though the merge didn't result in any code changes, and that's not uncommon with merges, Subversion still marks that a merge was done. If nothing else, marking that you did a merge -- even though it resulted in no changes, is still a good idea. Imagine a release going out, and someone saying "Wait, no one merged that branch back into the trunk! We'll have to delay the release until we get that done" because they didn't see the merge in the svn:merge-info record.

所以,是的,您所看到的可能是正常行为.

So, yes what you saw can be normal behavior.

现在,如果您的问题是为什么我的更改没有被合并",那就是另一个问题了.Subversion 通常在合并方面做得很好,但你必须确保你做一些事情:

Now, if your question is "Why didn't my changes get merged", that's a different issue. Subversion usually does a good job with merges, but you have to make sure you do a few things:

  • 仅从项目的根目录合并,而不是单独的分支和文件.也有例外,但大多数时候您应该合并项目的分支.否则,您最终会到处都是 svn:merge-info.
  • 知道何时使用 --reintegrate 标志.您有一个分支A"(在本例中可能包括主干).你从分支A"创建一个分支B".
    • 从A"合并到B"时,不要使用--reintegrate
    • 当你从B"合并到A"时,记得使用--reintegrate.它改变了 Subversion 处理合并的方式.
    • Merge from the root of your project only, and not individual branches and files. There are exceptions, but most of the time you should be merging the branches of a project. Otherwise, you'll end up with svn:merge-info all over the place.
    • Know when to use the --reintegrate flag. You have a branch "A" (which could include trunk in this example). You make a branch "B" from branch "A".
      • When you merge from "A" to "B", you don't use --reintegrate
      • When you merge from "B" to "A", remember to use --reintegrate. It changes the way Subversion handled the merge.

      因此,如果 Subversion 没有合并应有的更改,请确保您正确使用了 --reintegrate,并且您没有遇到上述其他问题.

      So, if Subversion didn't merge in changes it should have, make sure that you're using the --reintegrate correctly, and that you're not having the other issues mentioned above.

      这篇关于SVN 修改文件上的 svn:mergeinfo 属性而没有更改的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆