Visual Studio 2005 有一個開源的Subversion插件,Ankhsvn (http://ankhsvn.tigris.org/),安裝後,VS 2005中將內置Subversion的支持,可以直接在VS裡面提交修改。我經常用它和TortoiseSVN 配合來使用Subversion,十分方便。
可是升級到Visual Studio 2008後,發現Ankhsvn沒有集成進來,因為目前的Ankhsvn還不支持VS2008,據說下個版本才會支持VS 2008。
不過這不影響我們在Visual Studio 2008中使用Ankhsvn,我們可以自己動手修改注冊表,將Ankhsvn集成進VS 2008。方法很簡單。
Dim shell, filename, fso, file, content
Set shell = CreateObject("wscript.shell")
Set fso = CreateObject("Scripting.FileSystemObject")
filename = "ankh.reg"
shell.run "reg export HKLM\SOFTWARE\Microsoft\VisualStudio\8.0\Addins\Ankh " & filename, 1, True
Set file = fso.OpenTextFile(filename, 1, False, True)
content = file.ReadAll
content = Replace(content, "VisualStudio\8.0", "VisualStudio\9.0")
content = Replace(content, ".NET 2005", ".Net 2008")
file.Close()
Set file = fso.OpenTextFile(filename, 2, True)
file.Write content
file.Close()
shell.run "reg import " & filename, 1, true
fso.DeleteFile filename