On 5/21/07, Larry Martell <firstname.lastname@example.org> 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.
Received on Tue May 22 01:45:04 2007