Пример #1
0
            static void ExtractMetaToCache(
                MergeChangesCategory category,
                Dictionary <string, MergeChangeInfo> cache)
            {
                List <MergeChangeInfo> changes = category.GetChanges();

                HashSet <string> indexedKeys = BuildIndexedKeys(
                    changes);

                for (int i = changes.Count - 1; i >= 0; i--)
                {
                    MergeChangeInfo currentChange = changes[i];

                    string path = currentChange.GetPath();

                    if (!MetaPath.IsMetaPath(path))
                    {
                        continue;
                    }

                    string realPath = MetaPath.GetPathFromMetaPath(path);

                    if (!indexedKeys.Contains(BuildKey.BuildCacheKey(
                                                  currentChange.CategoryType, realPath)))
                    {
                        continue;
                    }

                    // found foo.c and foo.c.meta - move .meta to cache
                    cache.Add(BuildKey.ForChange(currentChange), currentChange);
                    changes.RemoveAt(i);
                }
            }
Пример #2
0
        static int GetSolvedChildrenCount(
            MergeChangesCategory category,
            MergeSolvedFileConflicts solvedFileConflicts)
        {
            int solvedDirConflicts = 0;

            if (category.CategoryType == MergeChangesCategory.Type.DirectoryConflicts)
            {
                foreach (MergeChangeInfo change in category.GetChanges())
                {
                    if (change.DirectoryConflict.IsResolved())
                    {
                        solvedDirConflicts++;
                    }
                }

                return(solvedDirConflicts);
            }

            return((solvedFileConflicts == null) ? 0 :
                   solvedFileConflicts.GetCount());
        }