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

Re: Svn log inside a post-commit hook

From: Hari Kodungallur <hkodungallur_at_gmail.com>
Date: 2007-11-09 18:39:54 CET

On Nov 9, 2007 8:58 AM, Andy Levy <andy.levy@gmail.com> wrote:

> On 11/9/07, Harvey, Edward <Edward.Harvey@patni.com> wrote:
> > Hey all.
> >
> > I like the output of svn log:
> > [eharvey@localhost]$ svn log -r 207 --verbose
> > http://svnhost/repositories/myrepo
> >
> > ------------------------------------------------------------------------
> > r207 | eharvey | 2007-11-09 11:36:26 -0500 (Fri, 09 Nov 2007) |
> > 1 line
> > Changed paths:
> > M /trash/trash.txt
> > M /trash.txt
> >
> > here is my comment
> >
> > ------------------------------------------------------------------------
> >
> > But when I try to write "svn log" into a post-commit hook, it appears it
> > can't perform that operation. Svnlook works, but is there any
> > (relatively easy) way to get output like the above using svnlook? Or
> > any way to make svn log work inside a post-commit hook?
>
> Have you tried svnlook log?

Andy, 'svnlook log' only prints out the commit log message. It does not
print all the details like 'svn log'. The author / commit time / changed
files etc are all separate commands for svnlook.

Edward, what you could do is to have a line like this in the post-commit
hook:

    /usr/local/bin/svn log -r $REV "file://$REPOS" > /tmp/mylog

This should work.
[Of course the path to svn may be different for you. And $REV and $REPOS are
second and first params to the hook respectively].

Having said that in case you are using the log output to parse the details,
then you might just want to use separate svnlook commands to get all the
info.

Regards,
-Hari Kodungallur
Received on Fri Nov 9 18:40:24 2007

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.