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

Re: pre-commint.pl script

From: David Weintraub <qazwart_at_gmail.com>
Date: Tue, 16 Dec 2008 11:42:55 -0500

Okay, you can get a list of the files via the "svnlook log" command
that were modified by a particular transaction. You can also use
"svnlook cat" to print out each of those files in search of your XML
tag, but what do you do with it then?

There is no communication mechanism between the hook script and the
client who did the commit. You can't send back to the client the XML
tag value. You could print this in a log, or email it back, but that's
about it.

If you do that route, you should be using a post-commit hook script
since you aren't trying to prevent a commit.

The tmpl file is an example of sorts because it shows you how to pass
the information you need to your actual script. In most hooks, you get
the Transaction # and the Repository name as command line arguments.
You can then pass these to your script using the "svnlook" command.

The Transaction # will help you print out the list of files that were
changed, and even their content via the svnlook command -- all without
having to create an actual working copy. So, you need to take a look
at the "svnlook" command since you'll be using it for your actual
hook.

You can also look at the sample hook scripts in
http://svn.collab.net/repos/svn/trunk/contrib/hook-scripts/ which will
help you in understanding how to write your own hook script.

The secret is to understand the "svnlook" command and to be able to
parse its output. The main subcommands are going to be the "svnlook
changed" and "svnlook cat" commands.

On Tue, Dec 16, 2008 at 4:10 AM, Ilan Yaniv <Ilan.Yaniv_at_timetoknow.org> wrote:
> Hi,
>
> This is the first time that I need to write a hook in SVN.
>
> I am need to search for specific tag in xml file and send the value to the
> user.
>
> Could you please send me an example, not the tmpl file – it is not an
> example J
>
> Ilan Yaniv
>
> Configuration Management
>
> Phone: 03-7534333 ext. 5873
>
> Ilan.Yaniv_at_timetoknow.org

-- 
--
David Weintraub
qazwart_at_gmail.com
------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=1065&dsMessageId=985088
To unsubscribe from this discussion, e-mail: [users-unsubscribe_at_subversion.tigris.org].
Received on 2008-12-16 17:43:51 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.