The correct way to do a one-time-commit (so to speak) of File.txt is
to commit the default version as File.txt.tmpl and then not allow any
commits to it with a post-commit hook.
Then allow the users to copy File.txt.tmpl to File.txt and then modify that.
On 5/21/07, Hari Kodungallur <hkodungallur@gmail.com> wrote:
>
> 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
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Tue May 22 03:40:39 2007