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

Re: svnlook not looking too well

From: Ryan Schmidt <subversion-2007b_at_ryandesign.com>
Date: 2007-10-27 01:30:46 CEST

On Oct 26, 2007, at 17:36, MCaron@primetherapeutics.com wrote:

> Blair Zajac wrote on 10/26/2007 04:57:37 PM:
>
> > The default pre-commit script created by 'svnadmin create' does
> haveit in the
> > correct order, it's REPOS followed by TXN.
> >
> > REPOS="$1"
> > TXN="$2"
> >
> > The order of options doesn't matter, but the transaction must follow
> > the -t. So
> > these two are both correct and equivalent:
> >
> > $ svnlook log -t 93-1 /home/svn/repos/repos2 93-1
> > $ svnlook log /home/svn/repos/repos2 -t 93-1
> >
> > And this is how you want to run it
> >
> > # Make sure that the log message contains some text.
> > SVNLOOK=/usr/local/bin/svnlook
> > $SVNLOOK log -t "$TXN" "$REPOS" | grep "[a-zA-Z0-9]" > /dev/null
> || {
> > echo "$0: no log message for txn $TXN" 1>&2
> > exit 1
> > }
>
> Thanks, you are correct and I've corrected my syntax. However, now
> I'm getting "svnlook: No such transaction". When I test the hook
> by attempting a commit using TortoiseSVN, I just see 'pre-commit'
> hook failed with error output: Then nothing following. I can see
> by using debugging statements that it's failing at the svnlook and
> it's not getting to the svnperms.py. If I comment out the svnlook,
> it does get to the svnperms.py and I do get a message that I don't
> have permission to commit (which is correct). If I execute the
> svnlook on a command line I get the "svnlook: No such transaction".

Correct, there is no such transaction when you run it on the command
line. Subversion creates the transaction when the commit begins, and
deletes the transaction when the commit ends (whether the commit
succeeds or fails). You can change "-t" to "-r" and use an existing
revision number instead of a transaction ID for testing purposes if
you would like.

If you are using the svnlook line in the pre-commit.tmpl, then it is
expected that it will fail and not output a message if you commit a
revision with an empty log message. That's its purpose; to detect
that condition. If you would like for an error message to be output
in this case, then the expanded script posted above by Blair
accomplishes this.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Sat Oct 27 01:33:55 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.