Revious
Revious

Reputation: 8146

Is it possible to investigate what caused SVN to see a merge conflict?

Very often, when merging many changeset into another branch, I get merge conflicts which I don't expect at all. The behavior in some of those cases is suspect and I'd like to read a log of SVN telling me why he decided to see a conflict. I have lot of doubts that the file on the destination branch was modified by someone else.

Upvotes: 2

Views: 76

Answers (1)

Stewart
Stewart

Reputation: 4982

When you get a conflict, you can use svn log somefile on your branch to figure out what you've changed. You can use svn log svn://url/repo/branch/somefile on the other branch you are merging with to see what has changed for that file.

From this information you can deduce why SVN flagged a conflict. The conflict might be minor (tree conflicts and mergeinfo conflicts are usually pretty easy to resolve). If you have both changed the same line of a text file, then SVN will not only flag a conflict, but also modify the files so you can see the original version, your changes, and their changes.

You can use a merge tool (Beyond Compare, meld, TortoiseSVN merge) to resolve the conflict by reviewing the three versions and selecting which lines you want to keep from each version.

With all of this information, you should be able to figure out why a conflict was flagged.

You have suspicion that the other files weren't modified, so this investigation will give you certainty. If it turns out that no one had commited the files, then I suspect that the problem would be with mergeinfo. If you merge from other sources, and the other branch has merged other sources, then you'll get conflicts in the mergeinfo properties. That's meta data associated with the file that tells SVN what revs have already been merged in.

If you don't resolve the conflict at least once and commit the updated properties, then next time you merge, you'll just see the same problem again.

Upvotes: 1

Related Questions