tags:

views:

325

answers:

3

I have changes on a branch that I have merged to trunk in my working directory. Svn stat shows the correct list of changed files. However, the "svn stat" output includes a "+" in the history scheduled for commit on each file added new to the branch.

A + src\main\java\com....java

When I run "svn diff", the added files that have the "+" are not included in the patch output.

This seems broken. If a file is marked as added, then it's entire contents should be in the diff output. I tried passing the --notice-ancestry. There was no change to the diff output. The closest I can find to the same problem is these comments regarding copied/moved files

Does someone know how to get SVN to includes these files in the diff output?

I just tried an external diff program as suggested by this questions answer, but it didn't work for me.

A: 

The + character in the output of svn status indicates that the file has "History scheduled with commit". This means that the file is not actually a new file, but actually a direct descendant of some other file in the Subversion repository.

This means that there should be no output in svn diff, since the file has not actually changed. If you were to make some local modifications to the file, they would appear in the svn diff output.

Avi
I suspected the '+'. However, how can I use diff to create a diff that includes all changes (as seen from the trunk) for submission to a projects maintainers?
James A Wilson
@James: It might be difficult to do with history, since technically an svn copy or rename *cannot* be represented in standard diff format (and keep the history). You could remove the history of that file (`cp file file.bak; svn revert file; rm file; mv file.bak file; svn add file`) and then you would have the diff in `svn diff`, but you wouldn't keep the history, which would be too bad. You might have to include instructions for doing the transformation manually.
Avi
+1  A: 

When version 1.7 is released, svn diff will have a --show-copies-as-adds switch for that purpose. That's a good indication that versions through 1.6 don't have that ability.

Dingo
A: 

I had this same problem. It happened because the remote repository had gone missing (someone had accidentally deleted trunk). The files didn't work until the trunk was fixed.

Mikko Ohtamaa