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

Re: pre commit hook not working

From: Johan Corveleyn <jcorvel_at_gmail.com>
Date: Tue, 29 Jan 2013 13:42:12 +0100

On Tue, Jan 29, 2013 at 9:09 AM, Prachi Khade
<Prachi.Khade_at_kpitcummins.com> wrote:
>
> hi All,
>
> I am currently trying to make my Review Board work with svn on a fedora machine using pre commit hook.
>
> precommit:
> #!/bin/sh
> REPOS="$1"
> REV="$2"
> echo $REV
> /usr/bin/python "/home/svn/ovip/hooks/svn-hook-postcommit-review.py" "$REPOS" "$REV" || exit 1
>
> but when this hook gets a call by a commit on repo i get the following error :
> svn: Commit failed (details follow):
> svn: Commit blocked by pre-commit hook (exit code 1) with output:
> Parameter <rev> must be an int, was given 36-4m

36-4m looks like a transaction id, not a revision number. This is
expected, because a pre-commit hook is given a transaction id (TXN) as
its second argument (see the comments in pre-commit.tmpl that comes
with your subversion installation). When the pre-commit hook is run,
there is no revision created yet, so no revision number, only a
transaction id.

I suppose this svn-hook-*postcommit*-review.py only works from
post-commit hook, not from pre-commit hook ... since it only accepts a
revision number.

--
Johan
Received on 2013-01-29 13:43:05 CET

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.