Search code examples
svntortoisesvn

Merging Failure


I merged from branch to trunk and the merge failed. after merging 10 files, there were some files that were successfully merged and some that failed. We assume that the common denominator of the failed files was that they were committed in both branch and trunk. For example, the following files.

branch/sample.txt
Rev 129
Rev 13
Rev 1
trunk/sample.txt
Rev 130
Rev 13
Rev 1

I think that the merge is failing because trunk is newer. But it is just a guess. In such a case, how should I merge?

This is a merge command.

svn merge 1:HEAD ^c:temp/branch/sample.txt ^c:temp/trunk/sample.txt

Solution

  • This is a merge command.

    svn merge 1:HEAD ^c:temp/branch/sample.txt ^c:temp/trunk/sample.txt

    That's not how you normally reintegrate a branch into trunk.

    If you want to merge a branch into trunk using the svn.exe CLI, then check SVNBook | Reintegrating a branch.

    In a working copy of your project's trunk, run the following command:

    svn merge <URL-TO-BRANCH>
    

    Then resolve conflicts if any occur and svn commit the merge result.

    As suggested by @LazyBadger, you may also use the --dry-run option with svn merge. AFAIK, this option is called "Test Merge" in TortoiseSVN. The option lets you test if the merge completes without any conflicts before actually merging changes into your working copy.

    Note that text conflicts do not indicate a "failed merge". They occur when contributors have introduced changes on the same chunk of lines and the version-control system cannot automatically and unambiguously decide which changes to use in the final result of the merge. So you need to manually examine the conflicts and resolve them. See SVNBook | Resolve any conflicts and TortoiseSVN Manual | Resolving Conflicts.

    PS I've already answered your similar question, and I'm unsure if it's a new problem or you are still trying to merge the same branch.