[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: can I get daily log file by svn command

From: Karl Fogel <kfogel_at_red-bean.com>
Date: Thu, 12 Jun 2008 18:21:09 -0400

"vichy" <vichy.kuo_at_gmail.com> writes:
> I try to get daily log file of my svn but "svn log" seems have no such
> option.
> I know I can use "svn log -r x:y" to get the log between revision x to y.
> Is there any option I can use to get daily log?

I use this Bourne/Bash shell script. It updates an existing "log.out"
file, that is, a file containing 'svn log' output.

It does so by reading the most recent revision number from the top of
log.out, getting logs for only revisions more recent than that, and
prepending them to log.out. Using this technique, I update a complete
log every day. (Every now and then, I regenerate the entire log,
though, since people sometimes edit existing log messages.)

This one is written to work for Subversion's own sources, but you could
modify it, of course.

-Karl

# Prepend to existing svn log output in a file "log.out".
# Pass "-v" to get verbose log data, in which case file is "logv.out".
function quicklog
{
   PATH_TO_WD=`pwd`
   if [ `basename ${PATH_TO_WD}` != "subversion" ]; then
     echo "You must be in '${HOME}/[local]src/subversion' to run this."
     return 1
   fi

   URL="http://svn.collab.net/repos/svn/"
   FILE=log.out
   if [ "${1}" = "-v" -o "${1}" = "-v" ]; then FILE=logv.out; fi
   LASTREV=`grep -E "^r[0-9]+" ${FILE} | head -1 | cut -d " " -f 1 | cut -b2-`
   REV=`dc -e "${LASTREV} 1 + p"`
   svn log ${1} --incremental -rHEAD:${REV} ${URL} trunk branches > ql.tmp
   cat ${FILE} >> ql.tmp
   mv ql.tmp ${FILE}
}
alias shlog="quicklog"
alias shvlog="quicklog -v"

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe_at_subversion.tigris.org
For additional commands, e-mail: users-help_at_subversion.tigris.org
Received on 2008-06-13 00:21:26 CEST

This is an archived mail posted to the Subversion Users mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.