tags:

views:

546

answers:

2

I use an external diff tool with Subversion (Beyond Compare rules!), and one of the great features is being able to use the diff program to make some minor edits to the file as I'm reviewing the changes I've made.

But svn diff works differently on different projects of mine. In all, the left-hand file is a temp file containing the latest revision stored in Subversion (the head). But in some, the right-hand file is the actual working file, while in others it's a temp file copy of the working file. In the first case, I can make changes in the diff program and they affect the working copy. In the second case, I'm editing a temp file, so changes are lost.

Why does Subversion sometimes diff against the working file but sometimes against a temp copy of the working file? How can I make it always use the working file?

A: 

Perhaps there are some access problems. Try to set a file to read-only, if svn opens a temp file now, this is one possible answer to your question. In this case, perhaps some editor/IDE you use write-protects the file.

schnaader
Good thought, but it doesn't seem to have to do with write permissions or editors holding the file open.
Ned Batchelder
+6  A: 

Do you have any svn:keywords set on those files? If yes, then Subversion will create a temp file first which has all those expanded keywords 'unexpanded'. This is to avoid having all the keyword lines shown as different even if they haven't been changed.

For example, if you diff a file in your working copy against BASE, the BASE file has no keywords expanded (and is also stored with LF lineendings), while the file in your working copy has all keywords expanded (and may be stored with CRLF lineendings). If you haven't modified that file locally, 'svn diff' would show all lines as different (if the line endings don't match) or at least all lines with the keywords would be shown as different - which is not what you would expect.

Stefan
It was the svn:keywords property! Thanks.
Ned Batchelder