SharpSVN を使用してプログラムでフォルダーを「無視リストに追加」するにはどうすればよいですか
質問
SharpSVN を使用してプログラムでフォルダーを無視リストに追加するにはどうすればよいですか?
編集:試行:
これが私が試したことです
svnClient.GetProperty(new SvnUriTarget("svn://svn.foo.com/" + DatabaseName + "/"), SvnPropertyNames.SvnIgnore, out ignores);
ignores += " Artifacts";
var args = new SvnSetPropertyArgs() { BaseRevision = ???, LogMessage = "update ignore list" };
svnClient.SetProperty(new Uri("svn://svn.foo.com/" + DatabaseName + "/"), SvnPropertyNames.SvnIgnore, ignores, args);
しかし、BaseRevision を取得する方法がわかりません (手動で取得でき、それは機能しますが、試した GetProperty のすべての組み合わせでは取得できないようです)。
解決:バートの回答に基づく
SvnGetPropertyArgs getArgs = new SvnGetPropertyArgs(){};
string ignores = "Artifacts";
string result;
if(svnClient.GetProperty(new SvnUriTarget("svn://svn.foo.com/" + ProjectName + "/trunk/"), SvnPropertyNames.SvnIgnore,out result))
{
ignores = result + " Artifacts"; //TODO: check for existing & tidy formatting.
}
svnClient.SetProperty(UncPath.TrimEnd('\\'), SvnPropertyNames.SvnIgnore, ignores);
SvnCommit(svnClient);
解決
リストに格納されて無視「のsvn:無視」無視するファイル/ディレクトリが含まれている親ディレクトリのプロパティを。
(のSubversionブックのかsvn help propset
を参照してください)
だから、あなたは(存在する場合)、元のプロパティの値を取得し、余分な項目は空白で区切っ追加する必要がアイテムを追加します。このためSvnClient上の機能がGetPropertyメソッド及びてSetPropertyである()。
所属していません StackOverflow