我正在尝试使用 SharpSVN 自动化 Subversion 签入,但我遇到了 SvnClient.Add() 方法的问题,我相信这可能是一个错误。本质上, .Add() 没有将路径视为工作副本,但是 SvnClient.GetUriFromWorkingCopy() 认为它很好。似乎 .Add() 看起来比它应该高 1 个目录,我似乎无法通过使用 .Add() 来欺骗 .Add() 。或者 ..
我的代码证明如下。通过将路径指向工作副本的顶层并运行来复制。任何帮助表示赞赏!
static void Main(string[] args)
{
string PathToTest = @"C:\temp\sqlcompare";
SvnClient client = new SvnClient();
SvnAddArgs saa = new SvnAddArgs();
saa.Force = true;
saa.Depth = SvnDepth.Infinity;
Console.WriteLine(PathToTest);
Console.WriteLine(client.GetUriFromWorkingCopy(PathToTest));
try
{
client.Add(PathToTest, saa);
Console.WriteLine(@"Success");
}
catch (Exception ex)
{
Console.WriteLine(ex.Message);
}
Console.ReadKey();
}
这产生的输出:
C:\temp\sqlcompare
https://thisismycompanyname.svn.cvsdude.com/project/soltuionname/trunk/Database/
'C:\temp' is not a working copy
添加尾部斜杠也不起作用:
C:\temp\sqlcompare\
https://thisismycompanyname.svn.cvsdude.com/project/soltuionname/trunk/Database/
'C:\temp' is not a working copy