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

RE: Something like svn:executable for the read-only bit?

From: Geoff Field <Geoff_Field_at_aapl.com.au>
Date: Thu, 16 Jul 2015 13:57:28 +1000

> -----Original Message-----
> From: Branko Čibej [mailto:brane_at_wandisco.com]
> Sent: Thursday, 16 July 2015 10:53 AM
> To: users_at_subversion.apache.org
> Subject: Re: Something like svn:executable for the read-only bit?
>
> On 16.07.2015 02:41, Evan Driscoll wrote:
> > We have some generated files that, for logistical reasons, are way
> > easier to just check into the respository alongside the
> source than to
> > build on-demand. (They're small text files, not some big binary or
> > something like that.)
> >
> > Is there a way to instruct Subversion to remove write access when
> > checking them out?
> >
> > Obviously the user could just chmod them to add it back,
> but the point
> > is just to avoid someone unintentionally modifying the
> generated file
> > instead of the source, not to keep people from being jerks. :-)
>
> Setting the svn:needs-lock property will make files in the
> working copy read-only.

Hi Evan,

You can even do this automatically from the client settings or the server (from 1.5). If you look at the SVN book (http://svnbook.red-bean.com/) under Chapter 3: Advanced Topics -> Properties -> Automatic Property Setting, it talks about MIME types. It says that SVN will automatically set the svn:executable property on newly added or imported files whose execute bit is enabled. By enabling auto-props and including a MIME type statement similar to the following in your config file, you can automatically set the read-only properties:

In our Windows world, we use a registry tool to set it on the client. Here are the relevant bits of our .reg file:

...
[HKEY_CURRENT_USER\Software\Tigris.org\Subversion\Config\miscellany]
"enable-auto-props"="yes"
...
[HKEY_CURRENT_USER\Software\Tigris.org\Subversion\Config\auto-props]
...
"*.exe"="svn:needs-lock"
...

Obviously, this would need to be updated for your Unix system, but that's what we're doing here. The SVN book should give you good guidance there.

Regards,

Geoff

-- 
Apologies for the auto-generated legal boilerplate added by our IT department:
- The contents of this email, and any attachments, are strictly private
and confidential.
- It may contain legally privileged or sensitive information and is intended
solely for the individual or entity to which it is addressed.
- Only the intended recipient may review, reproduce, retransmit, disclose,
disseminate or otherwise use or take action in reliance upon the information
contained in this email and any attachments, with the permission of
Australian Arrow Pty. Ltd.
- If you have received this communication in error, please reply to the sender
immediately and promptly delete the email and attachments, together with
any copies, from all computers.
- It is your responsibility to scan this communication and any attached files
for computer viruses and other defects and we recommend that it be
subjected to your virus checking procedures prior to use.
- Australian Arrow Pty. Ltd. does not accept liability for any loss or damage
of any nature, howsoever caused, which may result
directly or indirectly from this communication or any attached files. 
Received on 2015-07-16 05:58:55 CEST

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.