[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 20:12:44 CET

On Nov 9, 2007 10:56 AM, Harvey, Edward <Edward.Harvey@patni.com> wrote:

> >
> > 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.
>
> Exactly right. What I'm looking for is the equivalent of "svn log
> --verbose" and there is no "svnlook log --verbose"
>
>
> > 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
>
> Actually, this is the reason for the post. If you look back at the
> original post, you'll see "But when I try to write 'svn log' into a
> post-commit hook, it appears it can't perform that operation."
>
> Inside a post-commit hook, "svn log" just exits with no output,
> presumably because svn server is still in the middle of an atomic
> operation. So "svn" can't do anything inside the post-commit hook, but
> "svnlook" still works.

It works for me. Things to note in the command is that every path should be
a full path (so "/usr/local/bin/svn" is necessary instead of "svn". Same
case with /tmp/mylog). Also, the repsository argument to the svn log command
should be a URL. $REPOS is only a path to the file system. Hence you need to
prefix file:// to make it a file URL.

>
>
> That being said, this is what I settled on as an alternative:
>
> I see that svnlook can do a whole bunch of stuff.
> svnlook author
> svnlook date
> svnlook log
> And so on. If I run svnlook several times, storing the output of each,
> I can gather all the info that "svn log --verbose" normally would
> display. And just assemble it myself.

Yes, this is the better way to do it, anyway -- unless all you need is to
assemble it and create a log text that you append to a file.

Regards,
-Hari Kodungallur
Received on Fri Nov 9 20:13:10 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.