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

Re: hooks and env

From: C. Michael Pilato <cmpilato_at_collab.net>
Date: 2005-02-26 07:39:48 CET

Chia-liang Kao <clkao@clkao.org> writes:

> Hi,
>
> So I'm trying to implement a pre-commit hook that is going to be
> installed by svk for the repositories it touches, to prevent
> accidental commits into mirrored paths by non-svk clients, which
> would lead to inconsistent states.
>
> So I have to distinguish the program invoking the commit. An
> obvious way is to set SVK environment variable from the svk library,
> and check so in the hook.
>
> However the run_hook_cmd in libsvn_repos has:
>
> err = svn_io_run_cmd (".", cmd, args, &exitcode, &exitwhy, FALSE,
> stdin_handle, null_handle, write_errhandle, pool);
>
> The FALSE indicates the hook is run under clean environment. So the
> $ENV{SVK} thing won't work.
>
> What can I do to implement what I want in the hook?

Does SVK not set any transaction properties that are distinguishable
from a well-behaved-yet-non-SVK client? If so, perhaps just teach
your hook to look for those transaction properties. If not, perhaps
teach SVN to set such a property, and teach to the pre-commit hook to
check for it, and then remove it.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Sat Feb 26 07:42:36 2005

This is an archived mail posted to the Subversion Dev mailing list.