git-svn-keyword-expand
, which looks like this:#! /bin/zsh
typeset -A revs
files=($@)
for n in {1..$#files} ; do
f=$files[$n]
h=$(git log -n 1 --pretty=format:%H -- $f)
revs[$h]=${revs[$h]-$(git svn find-rev $h)}
perl -pi -e 's/\$Revision[ :\d]*\$/\$Revision: '${revs[$h]}' \$/gp' $f
done
Just feed it a list of files, and it'll update them in place to whatever current revision they are at. It's a rather dumb tool, which doesn't cross reference the file list with which of those files actually have an
svn:keywords
property including Revision
in it, and it doesn't do any other keywords, but people that want that kind of thing might at least grab this as a starting point. Cheers!