mikeobrien.net Curriculum Vitae Blog Labs
Saturday, January 23, 2010

Our database scripts reside in our SVN repo and when we do an svn update we want to have a friendly reminder if they’ve been modified by another developer (so that we can sync up our local database). Client hook scripts seemed like a perfect choice for this, as did a PowerShell script. I ran into many quirks while trying to make this happen, one of which was that TSVN captures the output of a hook script in order to catch errors. This means that you cant really use hook scripts OOB for displaying a message. If your interested in having a setting in TSVN to change this behavior, please post a comment here.  Although in PowerShell we can issue a command to start up a new PowerShell instance to run our script, freeing us from the shackles of TSVN:

powershell.exe -command "& {start-process powershell.exe (([system.environment]::GetCommandLineArgs()|ForEach-Object -process { '\"{0}\"' -f $_ })[3..([system.environment]::GetCommandLineArgs().Length-1)])}" "-file" "C:\MyScript.ps1"

This command deals with some other quirks that I ran into. One is that the $args variable contains improperly parsed command line arguments when used in a -command. It doesn’t respect quoted qualifiers and splits on spaces even when a parameter is quote qualified. Also they need to be requalified before they are passed to the script or you run into the same issue. The command also drops the first few parameters as these are not needed and cause problems.

So all you have to do is create a hook script under TSVN settings and paste in the above command (With the path to your script) and your good to go. I suggest checking the “Hide the script...” checkbox as this call will cause an initial console window to popup and disappear if you don't.

image

Saturday, January 23, 2010 4:08:48 AM (GMT Standard Time, UTC+00:00)  #   |  Comments [0]  |  Trackback
Friday, September 18, 2009

After doing some googling, I found that the problem is that there are only so many overlay icon “slots” available. Here is a quote from the TSVN FAQ:

The overlay icons appear, but not all of them!

You may find that not all of these icons are used on your system. This is because the number of overlays allowed by Windows is limited to 15. Windows uses 4 of those, and the remaining 11 can be used by other applications. If you are also using TortoiseCVS, then there are not enough overlay slots available, so TortoiseSVN tries to be a "Good Citizen (TM)"? and limits its use of overlays to give other apps a chance.

  • Normal, Modified and Conflicted are always loaded and visible.
  • Deleted is loaded if possible, but falls back to Modified if there are not enough slots.
  • ReadOnly is loaded if possible, but falls back to Normal if there are not enough slots.
  • Locked is only loaded if there are less than 13 overlays already loaded. It falls back to Normal if there are not enough slots.
  • Added is only loaded if there are less than 14 overlays already loaded. It falls back to Modified if there are not enough slots.

You can change this by gong to the registry key HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\explorer\ShellIconOverlayIdentifiers and deleting identifiers that you don't need, to bring the count down to 11. I tried renaming them as some suggested, to change the alpha sort order, but that didn't seem to work for me. You can then reboot or kill and restart explorer to put this change into effect.

image

Friday, September 18, 2009 5:57:32 PM (GMT Daylight Time, UTC+01:00)  #   |  Comments [0]  |  Trackback
Creative Commons License