Search code examples
svnsvn-merge

Merge files with SVN


When there are conflicts between the working copy and the repository during updating, I'm using XCode's built in tool FileMerge.

How do I save the merged file? What I currently do is save the merged file instead of the original conflicted file.

But after saving the merged file and quitting FileMerge, the "svn merge" command doesn't quit, it's waiting for some input, but I don't know what to type in.

Hence I'm forced to quit the command by typing "ctrl-c" in the terminal. After quitting svn I get: "svn: Can't write to connection: broken pipe".

If I type in "svn status" after performing this operation there are "!" files in front of all the folders.

How do I merge files properly with SVN and XCode's FileMerge?


Solution

  • It's asking for you to say "r" for "resolved", which will remove the 'C' status from your file and accept your merged file as the resolved copy. Other options include "tf" for "theirs-full", "mf" for "mine-full", and "h" for help.

    You can use any editor you want to edit the merge -- either invoke it from the command-line with "e" (while processing the "svn merge" operation), or hit "p" to postpone which will get you back to the command-line, although your file will still be in conflict (status "C") and you will then have to manually invoke "svn resolved " to clear the C status.

    The "!" flag means that the files are all locked, because as far as svn is concerned it's still in the middle of the merge operation (which died because you aborted it with ^C).