Jump to content

SCC: Should you lock files when editing them?


Recommended Posts

OK, since no one else is going to bite, I'll start. I like locking. In a perfect world, we wouldn't need it because communication would be perfect between developers, so when someone wanted something then they'd know (or would be able to conveniently ask to find out) if a file's unlocked. This doesn't always work in practise, and merging binary files (like VIs :) ) can be a real pain. For example: (this happened to me over the last week) imagine two developers working feverishly on a project in parallel. It's one of those projects where there's lots to do, but thankfully there's good requirements and design documentation, so it's a to-do list of TestStand sequences to be populated (I say populated, because they all came from the same template). If there's no locking mechanism, then there only method is for the developers to talk to each other to make sure they're not stepping on each others' toes (did I mention there is considerable physical distance between the developers?) Don't misunderstand: I certainly don't suggest that locking should form the basis of a work scheduling system, but it's a good check/balance.

Link to comment

Our project has lots of typedefs and interconnected functionality. We (4 developers) use SVN and we don't use locking, but we sure don't look forward to merging. We have some conventions and some custom tools which help with the merging, but it makes me annoyed that they needed to exist. Sometime soon, I am going to try locking to see whether it improves our workflow.

Link to comment

Just a note for those of you who were using the instructions above to automatically add the svn:needs-lock property to labview files before commiting to the repository. I had multiple issues with the setup of the pre-commit hook file in the linked wiki, what turned out to be the problem was some issues with text parsing, I cleaned up the issues that I found (it was a major headache to debug) and am posting the modified coded below, please note that the SVNLOOK and TEMP variables are specific to my installation and may need to be modified for yours.

Regards,

Randy

 @ECHO OFFset REPOS=%1set TRANSACTION=%2set SVNLOOK=c:\svnserve\svnlook.exeset TEMP=c:\repository</P> <P>if exist %TEMP%\tempfile%2 del %TEMP%\tempfile%2for /f "usebackq tokens=1*" %%i in (`%SVNLOOK% changed -t %2 %1`) do @if NOT %%i==_D @echo %%j>> %TEMP%\tempfile%2  if not exist %TEMP%\tempfile%2 goto NOFILESADDED  for /f "usebackq tokens=*" %%i in (`findstr /E /I /R "\.bmp.$ \.gif.$ \.ico.$ \.jpeg.$ \.jpg.$ \.png.$ \.tif.$ \.tiff.$ \.doc.$ \.jar.$ \.odt.$ \.pdf.$ \.ppt.$ \.swf.$ \.vsd.$ \.xls.$ \.zip.$ \.vi.$ \.vit.$ \.ctl.$ \.llb.$ \.dwg.%CONTENT%#34; %TEMP%\tempfile%2`) do (  %SVNLOOK% propget -t %2 %1 svn:needs-lock "%%i" 1> nul 2> nul  if ERRORLEVEL 1 (   echo commit denied, binary files must have property svn:needs-lock >&2   type %TEMP%\tempfile%2 >&2   del %TEMP%\tempfile%2   EXIT /B 1   )  ):NOFILESADDEDdel %TEMP%\tempfile%2EXIT /B 0

QUOTE (jdunham @ Oct 5 2008, 11:54 PM)

Our project has lots of typedefs and interconnected functionality. We (4 developers) use SVN and we don't use locking, but we sure don't look forward to merging. We have some conventions and some custom tools which help with the merging, but it makes me annoyed that they needed to exist. Sometime soon, I am going to try locking to see whether it improves our workflow.
Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.