You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by Johan Corveleyn <jc...@gmail.com> on 2013/01/29 13:42:12 UTC

Re: pre commit hook not working

On Tue, Jan 29, 2013 at 9:09 AM, Prachi Khade
<Pr...@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