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

Re: Hook to check for a presence of file before committing

From: Ryan Schmidt <subversion-2010b_at_ryandesign.com>
Date: Mon, 30 Aug 2010 18:47:50 -0500

On Aug 30, 2010, at 12:50, Tech Geek wrote:

> I am just getting started with SVN and I am running the latest version of subversion on a Windows Server. I am looking for a pre-commit.bat hook that will check for presence of a particular file (say project.xml) before commiting to the repository. If the working copy that is about to be committed does not have that file then the commits are rejected else the commits are accepted.
> I tried looking into svnlook command but not sure how to that command to look for a particular file.

Subversion hook scripts run on the server, not the client, so they have no knowledge of the user's working copy. So there's no way to do what you want using Subversion's server-side hook scripts.

> I am using TortoiseSVN client.

I believe TortoiseSVN has client-side hook scripts that are separate from Subversion's server-side hook scripts. Perhaps you can do what you want that way. Even if you could, that would require all your users to use TortoiseSVN, and they could simply bypass the restriction by using another client.
Received on 2010-08-31 01:48:35 CEST

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.