How can I see all the historical changes made to a file in SVN?


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?

There's no built-in command for it, so I usually just do something like this:


# 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
        read r
        svn log -r$r [email protected]
        svn cat -r$r [email protected]

#       remaining revisions as differences to previous revision
        while read r
            svn log -r$r [email protected]
            svn diff -c$r [email protected]

Then, you can call it with:

history_of_file $1