Force user to lock file in SVN before editing
Asked Answered
N

2

29

We have some files in our project that can't be merged and hence the files must be locked by the users before editing them. Is there a way to force the user to lock a file before editing?

We are using Subversion and TortoiseSVN / VisualSVN.

Neogothic answered 20/2, 2009 at 15:21 Comment(1)
As others have stated, you can use the svn:needs-lock property on those files. You can use a pre-commit hook to require that these files have locks. You can also install a pre-unlock hook to prevent users from stealing locks. Usually, this isn't necessary.Kettledrummer
C
49

Two steps:

  • put the svn:needs-lock property on those files. That way they are check out read-only
  • when such a file must be modified, use the svn lock command and commit as usual

links:

Croft answered 20/2, 2009 at 15:29 Comment(0)
G
18

More specifically, if you have TortoiseSVN installed,

  1. Right-click the file in Windows Explorer, select TortoiseSVN->Properties
  2. Click New->NeedsLock
  3. Choose Locking required in the dialog:
  4. Click OK
  5. Commit the file
  6. Done!
Gilmagilman answered 15/10, 2013 at 6:1 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.