I know that I can svn diff -r a:b repo
to view the changes between the two specified revisions. What I'd like is a diff for every revision that changed the file. Is such a command available?
They are stored in the svn:log property. You can add the --revprop flag to the various property commands to view & edit this property.
By far the easiest way to revert the changes from one or more revisions, is to use the revision log dialog. Select the file or folder in which you need to revert the changes. If you want to revert all changes, this should be the top level folder. Select TortoiseSVN → Show Log to display a list of revisions.
To get an overview of your changes, use the svn status command. You may use svn status more than any other Subversion command. If you run svn status at the top of your working copy with no arguments, it detects all file and tree changes you've made.
The svn log command is used to display all the commits made on the repository or file. The svn log command is executed as follows: svn log Path.
There's no built-in command for it, so I usually just do something like this:
#!/bin/bash # history_of_file # # Outputs the full history of a given file as a sequence of # logentry/diff pairs. The first revision of the file is emitted as # full text since there's not previous version to compare it to. function history_of_file() { url=$1 # current url of file svn log -q $url | grep -E -e "^r[[:digit:]]+" -o | cut -c2- | sort -n | { # first revision as full text echo read r svn log -r$r $url@HEAD svn cat -r$r $url@HEAD echo # remaining revisions as differences to previous revision while read r do echo svn log -r$r $url@HEAD svn diff -c$r $url@HEAD echo done } }
Then, you can call it with:
history_of_file $1
Slightly different from what you described, but I think this might be what you actually need:
svn blame filename
It will print the file with each line prefixed by the time and author of the commit that last changed it.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With