Search code examples
svntortoisesvn

How do I solve merge conflicts from a patch file in TortoiseSVN


I have a patch file containing changes from a branch. I'd like to apply those changes to the master branch, but of course there are conflicts.

But when applying the patch, TortoiseSVN doesn't show the usual 3-panes window to solve conflicts. There's only a small window with the list of files and a column indicating the number of failures. Double-clicking only opens the patch file, and simply selecting only show the regular diff window (without the conflicts).


Solution

  • If the patch file contains all the changes from a branch X, then you can just merge branch X directly into master without going through a patch file.

    If the patch file contains only the changes from specific revisions on branch X, then you can select those revisions in the TortoiseSVN merge dialog. (In git, this would be called a "cherry-pick" instead of a "merge".) Again, no patch file needed.

    But if you have a patch file which contains the modifications for a subset of the files that were modified on the branch (and maybe even just specific revisions for those files), then it's a bit more complicated. Perhaps that's why you are using a patch file. To do that, you could:

    • Create a new branch Y which branches of from the same revision as branch X. (You can do this by using "show log" and then "create branch/tag from revision".)
    • Apply the patch to branch Y and commit. (Hopefully there will be no conflicts because the branch point was chosen correctly in the previous step.)
    • Merge branch Y into master. TortoiseSVN should now have all the information needed to present the 3-pane TortoiseMerge window for conflict resolution.