private void AddToPushListIfNeeded(AbstractProject project, List <AbstractProject> inOrderToPush, HashSet <AbstractProject> visited) { AssertIsForeground(); Contract.ThrowIfFalse(_tracker.ContainsProject(project)); // Bail out if any of the following is true: // 1. We have already started pushing changes for this project OR // 2. We have already visited this project in a prior recursive call if (_pushedProjects.Contains(project) || !visited.Add(project)) { return; } foreach (var projectReference in project.GetCurrentProjectReferences()) { AddToPushListIfNeeded(_tracker.GetProject(projectReference.ProjectId), inOrderToPush, visited); } inOrderToPush.Add(project); }
private void AddToPushListIfNeeded(AbstractProject project, List <AbstractProject> inOrderToPush, HashSet <AbstractProject> visited) { AssertIsForeground(); if (_pushedProjects.Contains(project)) { return; } if (!visited.Add(project)) { return; } foreach (var projectReference in project.GetCurrentProjectReferences()) { AddToPushListIfNeeded(_tracker.GetProject(projectReference.ProjectId), inOrderToPush, visited); } inOrderToPush.Add(project); }