public IEnumerable <TfsTreeEntry> GetFullTree() { var treeInfo = Summary.Remote.Repository.CreateObjectsDictionary(); var resolver = new PathResolver(Summary.Remote, "", treeInfo); IItem[] tfsItems; if (Summary.Remote.TfsRepositoryPath != null) { tfsItems = _changeset.VersionControlServer.GetItems(Summary.Remote.TfsRepositoryPath, _changeset.ChangesetId, TfsRecursionType.Full); } else { tfsItems = Summary.Remote.TfsSubtreePaths.SelectMany(x => _changeset.VersionControlServer.GetItems(x, _changeset.ChangesetId, TfsRecursionType.Full)).ToArray(); } var tfsItemsWithGitPaths = tfsItems.Select(item => new { item, gitPath = resolver.GetPathInGitRepo(item.ServerItem) }); return(tfsItemsWithGitPaths.Where(x => x.gitPath != null).Select(x => new TfsTreeEntry(x.gitPath, x.item))); }
public IEnumerable <TfsTreeEntry> GetFullTree() { var treeInfo = Summary.Remote.Repository.CreateObjectsDictionary(); //add mappings to the resolver _mappingsFile.Mappings.ForEach(m => { if (!treeInfo.ContainsKey(m.TfsPath)) { treeInfo.Add(m.TfsPath, new GitObject() { Path = m.LocalPath }); } }); var resolver = new PathResolver(Summary.Remote, "", treeInfo); IItem[] tfsItems; if (_mappingsFile.Mappings.Count > 0) { tfsItems = _mappingsFile.Mappings.SelectMany(m => _changeset.VersionControlServer.GetItems(m.TfsPathWithRoot(Summary.Remote.TfsRepositoryPath), _changeset.ChangesetId, TfsRecursionType.Full)).ToArray(); } else if (Summary.Remote.TfsRepositoryPath != null) { tfsItems = _changeset.VersionControlServer.GetItems(Summary.Remote.TfsRepositoryPath, _changeset.ChangesetId, TfsRecursionType.Full); } else { tfsItems = Summary.Remote.TfsSubtreePaths.SelectMany(x => _changeset.VersionControlServer.GetItems(x, _changeset.ChangesetId, TfsRecursionType.Full)).ToArray(); } var tfsItemsWithGitPaths = tfsItems.Select(item => new { item, gitPath = resolver.GetPathInGitRepo(item.ServerItem) }); return(tfsItemsWithGitPaths.Where(x => x.gitPath != null).Select(x => new TfsTreeEntry(x.gitPath, x.item))); }