[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 03:45:10 CEST

Either way works. It could be that File.txt is user specific, in which case
there is no point in allowing a user to check that in.
Also, I presume you meant pre-commit and not post-commit. By the time
post-commit is called, file is already committed.

On 5/21/07, Matt Sickler <crazyfordynamite@gmail.com> wrote:
>
> 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.
>

rgds
-Hari Kodungallur
Received on Tue May 22 03:45:28 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.