I have now started locking unaudited files in the repository. A special user called 'audit' has been created to do this lock. There are two reasons for this: 1. The user who locks the file can still commit without unlocking. Having a separate user to lock files removes this issue. 2. All developers can have the username and password for locking, providing a system wide user to lock files. (ask Fireball for the u/n & p/w)
How do you lock files? I'll list the method for tortoise-svn via the GUI. Die hard cmd line gurus can adapt it to suit :)
- Firstly, go into your tortoise-svn settings and on the general page, click 'clean now' for Subversion authentication data. This will remove your current u/n & p/w - To 'get a lock' on the file(s), right click the file / directory , navigate to tortoise-svn and select 'get lock'. Getting a lock will trigger svn to contact the server automatically and apply the lock. - Next pick the file / directory you just locked and right click. Select file properties and under the subversion tab add 'svn:needs-lock' from the combo box. Add a '*' for the value, check the recursive box and click set. This will ensure all locked files which are checked out are set as read only locally. This is just used as a handy reminder. - You can now commit the files which will add the svn:needs-lock property, however ensure that on the commit dialog, the 'keep locks' checkbox is selected otherwise it will remove the lock you just placed.
Once I've audited the code, how do I unlock the files? This is done as your regular username, not as the 'audit' user, so you can clean the 'audit' username / password in the same manner as before if you opted to save it. Again, I'll list the tortoise method.
- Right click on the file / directory you want to unlock, navigate to tortoiseSVN and select 'check for modifications' - Select the file(s) you want to unlock, right click and select 'break the lock'. SVN will automatically contact the repo and unlock the files. - Don't forget to remove the svn:needs-lock property from the files to ensure they are no longer checked out as read only.
I have so far locked the kernel, however I'm unsure if : 1. we're just gonna lock everything in one go (this would make life easy to start with) and unlock everything as we deem it to be OK 2. lock only dirs we thing need auditing and unlock once clean.
I personally prefer option 1 as it ensures we don't miss anything, and would probably be quicker in the long run.
Regards, Ged.
Ged Murphy wrote:
How do I unlock the files? This is done as your regular username, not as the 'audit' user, so you can clean the 'audit' username / password in the same manner as before if you opted to save it. Again, I'll list the tortoise method.
- Right click on the file / directory you want to unlock, navigate to
tortoiseSVN and select 'check for modifications'
- Select the file(s) you want to unlock, right click and select 'break
the lock'. SVN will automatically contact the repo and unlock the files.
- Don't forget to remove the svn:needs-lock property from the files to
ensure they are no longer checked out as read only.
I have so far locked the kernel, however I'm unsure if :
- we're just gonna lock everything in one go (this would make life
easy to start with) and unlock everything as we deem it to be OK 2. lock only dirs we thing need auditing and unlock once clean.
Ok, slight change of plan as per option 1. It definitely is much easier to lock everything at once and then unlock the code which has passed. I'm in the process of locking now via the user 'audit'
Once this is done ( about 1 hour), the method above applies to unlock the code. All devs will have the ability to 'break a lock'
Ged.
Ged Murphy wrote:
Ok, slight change of plan as per option 1. It definitely is much easier to lock everything at once and then unlock the code which has passed. I'm in the process of locking now via the user 'audit'
Once this is done ( about 1 hour), the method above applies to unlock the code. All devs will have the ability to 'break a lock'
Ged.
ok, everything should be locked now, with the exception of include, ntoskrnl/include , media, modules, regtests
I've just tried unlocking rbuild and explorer with my own user account and it worked fine. However it appears the lock must be broken before the svn:needs-lock property is removed.
For completeness, here is the method once again:
- Right click on the file / directory you want to unlock, navigate to tortoiseSVN and select 'check for modifications' - Select the file(s) you want to unlock, right click and select 'break the lock'. SVN will automatically contact the repo and unlock the files. - Remove the svn:needs-lock property from the files and commit to ensure they are no longer checked out as read only.
Happy auditing....
Regards, Ged.
Okay, i tried it out on "winver" and i want to add some notes to the instructions:
1) Right click on the file / directory you want to unlock, navigate to tortoiseSVN and select 'check for modifications'
2) click on the "check repository" button
3) Select the file(s) you want to unlock, right click and select 'break the lock'. SVN will automatically contact the repo and unlock the files.
4) Remove the svn:needs-lock property from the files (right-click -> "Properties" -> "Subversion" tab -> select the entry and click "remove").
5) And finally, "commit" the audited files to ensure they are no longer checked out as read only.
On Thu, 9 Mar 2006 10:15:04 +0100 "Klemens Friedl" frik85@gmail.com wrote:
Okay, i tried it out on "winver" and i want to add some notes to the instructions:
- Right click on the file / directory you want to unlock, navigate to
tortoiseSVN and select 'check for modifications'
click on the "check repository" button
Select the file(s) you want to unlock, right click and select 'break
the lock'. SVN will automatically contact the repo and unlock the files.
- Remove the svn:needs-lock property from the files (right-click ->
"Properties" -> "Subversion" tab -> select the entry and click "remove").
- And finally, "commit" the audited files to ensure they are no
longer checked out as read only.
Some further notes:
I needed to upgrade to a 1.3 client since my previous one didn't support the lock command.
You need to own the lock first before removing the needs-lock property. do this like 'svn lock --force foo.c'