1 private void FetchWorkingCopyDir(string path, List<LocalNode> nodes)
2 {
3 var statusArgs = new SvnStatusArgs
4 {
5 Depth = SvnDepth.Children,
6 RetrieveAllEntries = true,
7 ThrowOnError = false
8 };
9 Collection<SvnStatusEventArgs> list;
10 if (!SvnClient.GetStatus(path, statusArgs, out list))
11 return;
12 for (var i = 1; i < list.Count; i++)
13 {
14 var argse = list[i];
15 if (argse.Versioned)
16 {
17 nodes.Add(new LocalNode { FullPath = argse.FullPath, NodeKind = argse.NodeKind, NodeStatus = argse.LocalNodeStatus });
18 if (argse.NodeKind == SvnNodeKind.Directory)
19 FetchWorkingCopyDir(argse.FullPath, nodes);
20 }
21 else
22 {
23 var nodeKind = File.Exists(argse.FullPath) ? SvnNodeKind.File : SvnNodeKind.Directory;
24 nodes.Add(new LocalNode { FullPath = argse.FullPath, NodeKind = nodeKind, NodeStatus = argse.LocalNodeStatus });
25 if (nodeKind == SvnNodeKind.Directory)
26 FetchNotVersionedDir(argse.FullPath, nodes);
27 }
28 }
29 }
30
31 private void FetchNotVersionedDir(string path, List<LocalNode> nodes)
32 {
33 var files = Directory.GetFiles(path);
34 nodes.AddRange(files.Select(file => new LocalNode { FullPath = file, NodeKind = SvnNodeKind.File, NodeStatus = SvnStatus.NotVersioned }));
35 var dirs = Directory.GetDirectories(path);
36 foreach (var dir in dirs)
37 {
38 nodes.Add(new LocalNode { FullPath = dir, NodeKind = SvnNodeKind.Directory, NodeStatus = SvnStatus.NotVersioned });
39 FetchNotVersionedDir(dir, nodes);
40 }
41 }