How to use SharpSVN to programmatically "add to ignore list" for a folder

How can I use SharpSVN to programmatically add a folder to an ignore list?

EDIT: Trying:
That's what I tried

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);

But I don’t know how to get BaseRevision (I can get it manually, and it works, but all the GetProperty combinations that I tried seem to not give me.)

SOLUTION: based on Bert answer

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);
+5
source share
1 answer

The ignore list is stored in the 'svn: ignores' property in the parent directory, which contains the ignored file / directory. (See Subversion Book or svn help propset)

, , ( ), , . SvnClient - GetProperty SetProperty().

+4

All Articles