2

Is there an official property which defines what files automatically get a svn:needs-lock property set? It should be something which is stored in the repository, so nothing has to be configured for a new working copy.

Mot
  • 28,248
  • 23
  • 84
  • 121

3 Answers3

2

There isn't anything like this in official SVN. However, TortoiseSVN provides the tsvn:auto-props property, which does exactly what you want provided everyone always uses TortoiseSVN as their client. Otherwise, you'll have to write a pre-commit hook as suggested by Mark Loeser.

Matt McHenry
  • 20,009
  • 8
  • 65
  • 64
  • Isn't it a standard Subversion property not just Tortoise? See enable-auto-props [in the manual](http://svnbook.red-bean.com/nightly/en/svn.advanced.confarea.html#svn.advanced.confarea.opts.config) – Rup Jan 25 '11 at 12:05
  • 1
    @Rup: Yes, but enable-auto-props must be set in a config file created by hand on each client, which isn't what mklhmnn wanted. – Matt McHenry Jan 25 '11 at 12:54
  • Ah, the tsvn one is central? I'd missed that. Neat, thanks! (We use enable-auto-props and a hook on one of our repositories.) Although he actually said nothing configured for a new working copy, not new client machine. – Rup Jan 25 '11 at 13:38
  • Subversion (since 1.8) supports the svn:auto-props property which works similarly to tsvn:autoprops. – user48147 Apr 22 '21 at 04:16
1

I also don't know how to do this at the repository but there is another work around that requires a single actions at one client.

In the client you can select the folder (in my case root of the project) and then select TortoiseSVN->Properties. Then select 'New..' and needs-lock.

Now all subdirectories will get this property set. When you commit this change to the repository all files in the repository get the needs-lock set this way.

Autoprops doesn't always work. When adding files to the repository using the 'check for modifications' dialog the autoprops seem not to be set for files within folders.

  • You may want to see the thread on this question here http://stackoverflow.com/questions/711053/automatically-add-svnneeds-lock – magi182 Mar 28 '13 at 08:00
1

I do not know of anything that SVN provides explicitly that would allow you to do this. It should, however, but relatively trivial to implement such a thing using repository hooks.

I would just have something to check in the pre-commit hook to see if it matches your pattern and abort with a message telling them to set the correct properties if they are not set.

Mark Loeser
  • 17,657
  • 2
  • 26
  • 34