Reputation: 91
I use
svn diff -r $new:$old $file --summarize
to find out if the $file change between $new and $old. But if I add and delete the file over and over again. such as
add $file revision 230
delete $file revision 231
add $file revision 232
while the $file added at 230 and 232 is the same path and same name but different content, then call
svn diff -r $230:$232 $file --summarize
svn show nothing changed while I expect a result that tell me $file is modified.
How can I fix this problem?
Upvotes: 0
Views: 992
Reputation: 10419
First off, the --summarize option has a specific purpose that is mainly when comparing trees of files. It is to just show the list of files with differences as opposed to the detailed diff for each file. It has no value when used for a single file.
Second, diff is always simply comparing two snapshots of a file or tree. It does not care how the file got into the state it is in, just what it looks like in the snapshot. So for example, if you remove a block of code in one revision, add it back in the next, then change one line in a third. And then do a diff of the current revision with the code before all of this, it would only show one line of code as changed. It does not consider any of the changes that happened in between.
If you are looking to see all of the changes in a revision range, you want to use svn log.
Upvotes: 1
Reputation: 2430
Though you are adding files with same name, SVN will internally consider it as two entities. So your command is trying to find the revision deference of the file between revisions 231 and 232, where at revision 231 the current file is not even present in SVN. You have to do svn diff
on the parent folder in this case instead of on the file.
Upvotes: 0