Bypassing Corporate Bureaucracy To Use SVN

the best google result for "svn"What do you do when your company is too bureaucratic to give it's developers access to any kind of version control whatsoever? You roll your own. Well, not exactly. I'm not about to re-write my own in house version control system. But when I'm prevented from using TortoiseSVN, I go the old command line route. TortoiseSVN is a nice graphical frontend to SVN. It embeds itself in Explorer's context menu. Barring that, I had to write .VBS files to run the various commands: commit, log, update, etc.

Here are samples of various SVN commands I had to write scripts for.

 

Commit

'Author: Jozef Nagy
'Date: 7/1/2008
'Simple script to commit changes in a working copy to an SVN repository.

Dim strMsg
Dim strWorkingCopy
Dim strSVN
Dim fs
Dim WshShell

strWorkingCopy = "C:\Documents and Settings\jnagy001\My Documents\Projects\Most_Awesome_App_Ever"
strSVN = "C:\path\to\local\svn\svn-win32\bin\svn"

Set fs = CreateObject("Scripting.FileSystemObject")
Set WshShell = WScript.CreateObject("WScript.Shell")
strMsg = InputBox("Enter comment for commit:")

if not fs.FileExists(strSVN & ".exe") then
'can't launch the file.
WScript.echo "Cannot launch application. Please contact System Support team."
end if

WshShell.Exec strSVN & " commit " & Chr(34) & strWorkingCopy & Chr(34) & " -m " & Chr(34) & strMsg & Chr(34)

 

Log

cd "C:\tem\svn\svn-win32\bin"
svn log "file:///P:/CRM/TEMP/svn/ascsb"

pause

 

Update

'Author: Jozef Nagy
'Date: 7/1/2008
'Simple script to commit changes in a working copy to an SVN repository.

Dim strWorkingCopy
Dim strSVN
Dim fs
Dim WshShell

strWorkingCopy = "C:\Documents and Settings\jnagy001\My Documents\Projects\DB Migration"
strSVN = "C:\tem\svn\svn-win32\bin\svn"

Set fs = CreateObject("Scripting.FileSystemObject")
Set WshShell = WScript.CreateObject("WScript.Shell")

if not fs.FileExists(strSVN & ".exe") then
'can't launch the file.
WScript.echo "Cannot launch application. Please contact CFM System Support team."
end if

WshShell.Exec strSVN & " update " & Chr(34) & strWorkingCopy & Chr(34)