tags:

views:

76

answers:

3

I just ran into a conflict while working in SVN, and I find myself missing a bit of functionality from Mercurial. In Mercurial, I have vim -d set up as my diff tool. I'm wondering if there is a way to get SVN to work in a similar way? Something along the lines of:

$ svn resolve whatever.py 

Which would bring up vim (in diff mode), allow me to fix the file, and then do an svn resolved to clean up. I work exclusively in CLI (mostly over SSH), so graphical diff tools need not apply.

Does such a thing exist?

Update:
It is probably worth including where in the process I am. I've edited a file (whatever.py), saved it, and done an svn update where someone else has also changed the file. So my svn stat looks like so:

?      whatever.py.mine
?      whatever.py.r7822
?      whatever.py.r7908
C      whatever.py
+1  A: 

Whenever I have a conflict from a svn update, I'm asked for a half dozen options, one of which is to edit the file in question. Perhaps you need a newer version of Subversion. I'm running 1.6.9.

Andy Lester
This is a pretty old version of subversion, but the question still applies if I decide to postpone resolving this issue.
Jack M.
So... You're right. The only thing that is missing is the command to actually do the merge. It's `svn merge`. Once I got the updated version, it worked. Toss that in there so I can mark it right. =-]
Jack M.
A: 

In more recent versions of the subversion CLI client, you can set an environment variable SVN_MERGE=vim -d and then select l to launch external tool when a conflict menu comes up during an svn update.

I'm not 100% sure if the parameter order passed by svn matches the one required by vim -d so you might have to write a wrapper script instead of directly calling vim.

The svn manual has full details, of course.

Amardeep
A: 

Try setting the environment variables EDITOR or VISUAL to vim

the_mandrill
That works for commits and the like, but it doesn't change the diff. I'm already using vim as my `EDITOR`.
Jack M.