Force user to lock file in SVN before editing

对着背影说爱祢 提交于 2019-11-27 01:30:54

问题


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.


回答1:


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:

  • http://svnbook.red-bean.com/nightly/en/svn.advanced.locking.html
  • http://tortoisesvn.net/docs/release/TortoiseSVN_en/tsvn-dug-locking.html



回答2:


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!


来源:https://stackoverflow.com/questions/569948/force-user-to-lock-file-in-svn-before-editing

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!