How can I get the number of files in a repository ? I've tried this C# code to get the tree of a repository :
private TreeNode GetRepoTreeNodes(string currentrepourl, string currentnodepath, ref SvnClient sc)
{
List<TreeNode> tnkids = new List<TreeNode>();
//using (SvnClient sc = new SvnClient())
//{
Collection<SvnListEventArgs> repocontents = null;
if (sc.GetList(new Uri(currentrepourl), out repocontents))
{
foreach (SvnListEventArgs kiditem in repocontents)
{
if (!string.IsNullOrEmpty(kiditem.Path))
{
TreeNode tn = GetRepoTreeNodes(currentrepourl + @"/" + kiditem.Path, kiditem.Path, ref sc);
// TreeNode tn = new TreeNode(kiditem.Path, tnkids.ToArray());
tnkids.Add(tn);
}
}
}
//}
TreeNode thenode = new TreeNode(currentnodepath, tnkids.ToArray());
return thenode;
}
The problem is, when it reaches the end of the loap, it still treats the file as a directory and it throws an exception. I couldnt find a solution. If you have an other way to satisfy this purpose please help with with it. Thank you