Alex Rivera | Logout

svn diff for a complete file?

Asked 2009-08-21T12:56:48.303
11

Given: an SVN repository, a bin directory inside it and a script.pl inside this bin. Some revisions ago, bin and script.pl has been added to the repository in one commit. Since then, some revisions has been applied to script.pl.

Needed: a diff command which would return a complete diff for script.pl from zero to HEAD, i.e. a diff with all lines added.

Background: this diff is needed for code review, for feeding to ReviewBoard

Problem: svn diff with -r X:HEAD (X being the first revision of script.pl) produces a diff between the first version and HEAD while -r X-1:HEAD tell me the file script.pl is unknown in the revision X-1, which is actually correct. However, I can't find a proper solution which would include the diff from an empty file. I also can't diff the bin directory, since it has been added in the same commit as script.pl

Solution: ?

Edit
Report

2 Answers

1

This is the hack I use in this situation:

cp file1 file2
svn add file2
svn diff file2 > file1.diff
svn rm --force file2
answered 2013-03-20T17:45:08.223
0

I faced the same problem and also didn't find a solution.

The workaround was to produce diff of a couple of recent revisions of the file, then "Expand changes" shows you the complete file and allows to comment anywhere.

answered 2011-01-19T03:35:52.940

Your Answer