C# SharpSvn GetLog ChangedPaths NodeKind始终未知
代码C# SharpSvn GetLog ChangedPaths NodeKind始终未知,c#,.net,svn,sharpsvn,C#,.net,Svn,Sharpsvn,代码 using (var svnClient = new SvnClient()) { Collection<SvnLogEventArgs> svnLogEntries; svnClient.GetLog(new Uri("https://DbDiff.svn.codeplex.com/svn"), out svnLogEntries); foreach (var svnLogEntry in svnLogEntries) { fo
using (var svnClient = new SvnClient())
{
Collection<SvnLogEventArgs> svnLogEntries;
svnClient.GetLog(new Uri("https://DbDiff.svn.codeplex.com/svn"), out svnLogEntries);
foreach (var svnLogEntry in svnLogEntries)
{
foreach (var changedPath in svnLogEntry.ChangedPaths)
{
Debug.WriteLine("NodeKind: " + changedPath.NodeKind + ", Path: " + changedPath.Path);
}
}
}
为什么
changedPath.NodeKind
总是“未知”?我希望上面的输出是“文件”..并非所有服务器都发送nodeKind请求“log”。见本讨论:
看起来我可以使用SvnClient.GetInfo获得正确的NodeKind,但是为每个更改的路径调用此函数非常慢
using (var svnClient = new SvnClient())
{
Collection<SvnLogEventArgs> svnLogEntries;
string repoUri = "https://DbDiff.svn.codeplex.com/svn";
svnClient.GetLog(new Uri(repoUri), out svnLogEntries);
foreach (var svnLogEntry in svnLogEntries)
{
foreach (var changedPath in svnLogEntry.ChangedPaths)
{
SvnInfoEventArgs svnInfo;
svnClient.GetInfo(new SvnUriTarget(repoUri + changedPath.Path, svnLogEntry.Revision), out svnInfo);
Debug.WriteLine("NodeKind: " + svnInfo.NodeKind + ", Path: " + changedPath.Path);
}
}
}
使用(var svnClient=new svnClient())
{
贵族收藏;
字符串repoUri=”https://DbDiff.svn.codeplex.com/svn";
GetLog(新Uri(repoUri),输出svnLogEntries);
foreach(svnLogEntry中的var svnLogEntry)
{
foreach(svnLogEntry.ChangedPaths中的var changedPath)
{
Svninfeeventargs svnInfo;
GetInfo(新的SvnUriTarget(repoUri+changedPath.Path,svnLogEntry.Revision),输出svnInfo);
Debug.WriteLine(“NodeKind:+svnInfo.NodeKind+”,路径:+changedPath.Path);
}
}
}
您可以使用以下想法将其加速一点:如果日志包含“一个com”和“一个com/codeplex”条目,那么“com”是一个目录,它不需要任何“信息”请求。。。对于其他人——是的——您必须单独请求nodeKind。Codeplex是TFS上的代理,在+-Subversion 1.6级别实现一些Subversion API,但不是所有API。例如,错误支持被破坏。NodeKind需要Subversion 1.6+存储库格式和存储库。(当然还有一个新客户,但如果您在SharpSvn拥有房产,您就拥有了这个客户)