Exemplo n.º 1
0
            static void ExtractMetaToCache(
                IncomingChangesCategory category,
                Dictionary <string, IncomingChangeInfo> cache)
            {
                List <IncomingChangeInfo> changes = category.GetChanges();

                HashSet <string> indexedKeys = BuildIndexedKeys(
                    changes);

                for (int i = changes.Count - 1; i >= 0; i--)
                {
                    IncomingChangeInfo 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);
                }
            }
Exemplo n.º 2
0
        static int GetSolvedChildrenCount(
            IncomingChangesCategory category,
            MergeSolvedFileConflicts solvedFileConflicts)
        {
            int solvedDirConflicts = 0;

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

                return(solvedDirConflicts);
            }

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