1

コード

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

出力

NodeKind: Unknown, Path: /DbDiffCommon/DataAccess/SqlCommand11.xml
NodeKind: Unknown, Path: /DbDiffCommon/DataAccess/SqlCommand9.xml
NodeKind: Unknown, Path: /DbDiffCommon/DataAccess/SqlCommand11.xml
NodeKind: Unknown, Path: /DbDiffCommon/DataAccess/SqlCommand7.xml
NodeKind: Unknown, Path: /DbDiffCommon/DataAccess/SqlCommand8.xml
NodeKind: Unknown, Path: /DbDiffCommon/DataAccess/SqlCommand9.xml
NodeKind: Unknown, Path: /DbDiffCommon/Model/DatabaseConnectString.cs
NodeKind: Unknown, Path: /DbDiffCommon/Helper/Enums.cs
NodeKind: Unknown, Path: /DbDiffWinClient/Forms/frmRegisterServer.resx
NodeKind: Unknown, Path: /DbDiffWinClient/Forms/frmConnectDb.resx
NodeKind: Unknown, Path: /DbDiffWinClient/Forms/frmRegisterServer.cs
NodeKind: Unknown, Path: /DbDiffWinClient/Forms/frmConnectDb.cs
NodeKind: Unknown, Path: /DbDiffCommon/Model/RegisteredServer.cs
NodeKind: Unknown, Path: /DbDiffWinClient/ChangeLog.txt
NodeKind: Unknown, Path: /DbDiffWinClient/Forms/DbItems/ucTableDiffInfo.cs
NodeKind: Unknown, Path: /DbDiffCommon/DataAccess/DatabaseDataSets.cs
...

なぜchangedPath.NodeKind常に「不明」なのですか?上記の出力の「ファイル」であると思います..

4

2 に答える 2

2

すべてのサーバーが「ログ」リクエストに対して nodeKind を送信するわけではありません。この議論を参照してください: http://old.nabble.com/SVNNodeKind-%3D-UNKNOWN-td34018265.html#a34018265

于 2012-07-29T12:52:06.803 に答える
1

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);
        }
    }
}
于 2012-07-29T13:02:03.517 に答える