private void TakeDepsToProcessFromQueue(DepsQueue queue, IList <DepWithParent> depsPool, IList <DepWithParent> backToQueue, ModulesContainer processed) { while (!queue.IsEmpty()) { var curDep = queue.Pop(); if (curDep.Dep.Treeish == null) { curDep.Dep.Treeish = processed.GetTreeishByName(curDep.Dep.Name); } if (processed.IsProcessed(curDep.Dep)) { continue; } processed.ThrowOnTreeishConflict(curDep); if (depsPool.Select(d => d.Dep.Name).Contains(curDep.Dep.Name)) { backToQueue.Add(curDep); } else { depsPool.Add(curDep); } } }
private void GetDeps(string force, DepsQueue queue, ModulesContainer processed) { while (!queue.IsEmpty()) { var depsPool = new List <DepWithParent>(); var backToQueue = new List <DepWithParent>(); TakeDepsToProcessFromQueue(queue, depsPool, backToQueue, processed); foreach (var dep in depsPool) { processed.AddConfig(dep.Dep.Name, dep.Dep.Configuration); } queue.AddRange(backToQueue); ProcessDeps(force, depsPool); MarkProcessedDeps(queue, processed, depsPool); AddNewDeps(queue, processed, depsPool); } if (errorOnMerge) { ConsoleWriter.WriteWarning($"Branch '{mergedBranch}' was not merged into some of dependencies"); } }