I wanted an answer, myself. Try the following to output only deletes from svn log
.
svn log --stop-on-copy --verbose [--limit <limit>] <repo Url> | \
awk '{ if ($0 ~ /^r[0-9]+/) rev = $0 }
{ if ($0 ~ /^ D /) { if (rev != "") { print rev; rev = "" }; print $0 } }'
This filters the log output through awk. awk buffers each revision line it finds, outputting it only when a delete record is found. Each revision is only output once, so multiple deletes in a revision are grouped together (as in standard svn log
output).
You can specify a --limit
to reduce the amount of records returned. You may also remove the --stop-on-copy
, as needed.
I know there are complaints about the efficiency of parsing the whole log. I think this is a better solution than grep and its "cast a wide net" -B
option. I don't know if it is more efficient, but I can't think of an alternative to svn log
. It's similar to @Alexander Amelkin's answer, but doesn't need a specific name. It's also my first awk script, so it might be unconventional.