Is it possible to set up TortoiseMerge (comes with TortoiseSVN) to be the external merge tool that pops up when you encounter a merge conflict using the "svn merge" commandline? I have tried setting my environment variable "SVN_MERGE" to point to TortoiseMerge.exe, but this doesn't seem to be enough. TortoiseMerge just pops up when I choose "l" (to launch an external tool) asking me what files I want to merge. I want this information to be pushed into the tool automatically.
Any ideas?
I don't know which version of Subversion you're using, so I'm going to try to refer to information in the most recent version of the Subversion documentation, for 1.6. (They add on that page that "if you bookmark or link to specific sections, those links may be invalidated by continuing development." But there is no stable version for 1.6.)
First, the bad news:
The slightly better news is that Subversion has anticipated your question, somewhat. See the section Using External Differencing and Merge Tools; there are templates of external merge tool wrappers.
In your specific case, the TortoiseMerge documentation has an appendix explaining how to use it from the command line. The essential switches are
/base
,/mine
, and/theirs
, but you may want to use more (you're writing your own wrapper script, after all). TortoiseMerge also allows a "simplified form" of the command:The way to communicate the results of your merge back to Subversion is by writing the merged file to standard output and returning an appropriate value. This information is placed prominently in the wrapper templates in the Subversion manual.