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

Re: Read-only files?

From: Bruce Webber <brucewebber_at_fastmail.us>
Date: 2005-12-16 17:45:45 CET

--Kjell H Andersen <kha-svn@lentic.net> wrote:

> That's actually only half the truth.
> By setting svn:needs-lock, the files will be read only when you check
> them out. If you acquire a lock, the file will be read enabled. However,
> if a user decides to make the file writable by using chmod +w (or
> unchecking the Read only tick in Windows), there is nothing that prevents
> him from editing the file and then committing it.

If someone has locked the file, no one else will be able to commit it.
Changing the read-only property of the file in the working copy does not
circumvent this.

> The locking mechanism is just for communication between team members.

No, I believe locking a file prevents other people from committing changes
(regardless of the needs-lock property). The needs-lock property serves to
communicate the team policy.

> If
> you encounter a read-only file, the warning lights should flash, and you
> should get a lock on it before doing anything. If a team member fails to
> do that, and edit it anyway, he is undermining the system and may cause
> trouble for his team.

Agreed.

> I would suggest some kind of clever hook script similar to the one that
> prevents tags from being edited.

Another possibility is to make changes in the auto-props section of the
Subversion configuration file on each PC. There you can specify that files
with certain extensions will have the needs-lock property set whenever they
are added to Subversion. The drawback here is that it has to be done on
each client.

> Steve Williams wrote:
>> Andrew Bell wrote:
>>> Is there a property or something that I can set so that a file can be
>>> cheked in, once it, won't get committed unless you do something
>>> special, even if you change it?
>>
>> Add the svn:needs-lock property to the file. Then a user needs to get
>> a lock on the file before committing it.
>>

-- 
Bruce Webber
brucewebber@fastmail.us
http://brucewebber.us
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Fri Dec 16 17:48:34 2005

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.