Zooking
Zooking

Reputation: 3521

Force user to lock file in SVN before editing

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.

Upvotes: 29

Views: 30384

Answers (2)

Godsmith
Godsmith

Reputation: 2612

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!

Upvotes: 19

cadrian
cadrian

Reputation: 7376

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:

Upvotes: 49

Related Questions