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:
To use a merge tool, you need to
either set the SVN_MERGE environment
variable or define the merge-tool-cmd
option in your Subversion
configuration file (see the section
called “Configuration Options” for
more details). Subversion will pass
four arguments to the merge tool: the
BASE revision of the file, the
revision of the file received from the
server as part of the update, the copy
of the file containing your local
edits, and the merged copy of the file
(which contains conflict markers). If
your merge tool is expecting arguments
in a different order or format, you'll
need to write a wrapper script for
Subversion to invoke.
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:
TortoiseMerge BaseFilePath MyFilePath TheirFilePath
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.