Visual Studio では VSS を使えッ!!! ってのが定番ですが、「それってお高いんでしょう?」ってな具合に SubVersion を使うことが多々あります(最近は git なのか?)
ankhsvn: Subversion Support for Visual Studio
http://ankhsvn.open.collab.net/
これをインストールすると Visual Studio 上から VSS ライクに SubVersion のリポジトリを操作できるので便利です。
が、checkout をするのに、いちいち Visual Studio を立ち上げないと駄目ってのが面倒なのです。それで、別途
tortoisesvn.tigris.org
http://tortoisesvn.tigris.org/
なものを入れて、エクスプローラから直接操作できるようにするのが普通なのですが、これって 、
・SVN のクライアントが二重に入っているのが変
・コマンドラインで一発で checkout するほうが、バッチ処理的に便利
なわけです。
で、最近気づいたのですが、ankhsvn をインストールしたフォルダには SharpSvn.dll なんていう、それらしいファイルがあるじゃないですか。
探してみれば、
sharpsvn: Samples
http://sharpsvn.open.collab.net/servlets/ProjectProcess?documentContainer=c4__Samples&view
というサンプルがあったりして。
試しに下記のように、書いただけで checout と update が簡単にできます。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | imports SharpSvn Module Module1 Sub Main() Dim addr As New Uri( "svn://..." ) Dim outdir As String = Directory.GetCurrentDirectory Dim client As New SvnClient AddHandler client.Notify, AddressOf prog if Directory.Exists( ".svn" ) = false then Console.WirteLine( "svn checkout" ) client.CheckOut( addr, outdir ) else Console.WirteLine( "svn update" ) client.CheckOut( outdir ) end if End Sub public sub prog( byval sender as object, e as SharpSvn.SvnNotifyEventArgs ) Console.WriteLine(e.Path) end sub End Module |
実は cygwin が入っていると svn クライアントが既に入っているんですよね。
環境が許さない時には、上記のような方法が便利かと。