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

Re: Allowing checkout of a file, but preventing checking

From: Hari Kodungallur <hkodungallur_at_gmail.com>
Date: 2007-05-22 01:44:44 CEST

On 5/21/07, Larry Martell <larry.martell@gmail.com> wrote:
>
> We have a situation where we need to keep a template version of
> a file under SVN control, and allow users to checkout this template
> into their working copy. We want them to be able to modify this
> file in their working copy, but we do not want them to be able to
> check their changes to this file back in. Is there any way to
> achieve this with SVN? (We can't set svn:needs-lock and then
> lock the file because then it gets checked out read-only).

You can do this in a the pre-commit hook. If the template file is in
/trunk/mytemplates/file.tmpl, then you can reject a check-in if the incoming
file list has the path /trunk/mytemplates/file.tmpl.

You could possibly also include a check to see if the 'author' of the
transaction is a certain user who is 'privileged. And that user may be able
to check-in the file. Without this check, if the user who controls the
template file has to check-in a modification, that will be rejected as well.

regards,
-Hari Kodungallur
Received on Tue May 22 01:45:04 2007

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.