Example #1
0
        static void DoFileConflictsHeader(
            MergeTreeResult conflicts,
            MergeSolvedFileConflicts solvedFileConflicts,
            MountPointWithPath mount)
        {
            int fileConflictsCount        = MergeTreeResultParser.GetFileConflictsCount(conflicts);
            int pendingFileConflictsCount = MergeTreeResultParser.GetUnsolvedFileConflictsCount(
                conflicts, mount.Id, solvedFileConflicts);

            GUIStyle pendingFileConflictsOfTotalStyle =
                pendingFileConflictsCount > 0 ?
                UnityStyles.IncomingChangesTab.RedPendingConflictsOfTotalLabel :
                UnityStyles.IncomingChangesTab.GreenPendingConflictsOfTotalLabel;

            GUILayout.Label(
                string.Format("{0}/{1}", pendingFileConflictsCount, fileConflictsCount),
                pendingFileConflictsOfTotalStyle);

            GUILayout.Label(
                MergeViewTexts.GetFileConflictsCaption(fileConflictsCount, true),
                UnityStyles.IncomingChangesTab.PendingConflictsLabel);

            GUILayout.Space(5);

            GUILayout.Label(
                MergeViewTexts.GetChangesToApplyCaption(
                    MergeTreeResultParser.GetChangesToApplySummary(conflicts)),
                UnityStyles.IncomingChangesTab.ChangesToApplySummaryLabel);
        }
Example #2
0
        void UpdateOverview(
            MergeTreeResult resultConflicts,
            MergeSolvedFileConflicts solvedFileConflicts,
            MountPointWithPath rootMountPoint)
        {
            if (resultConflicts == null || rootMountPoint == null)
            {
                mChangesSummary         = new MergeViewTexts.ChangesToApplySummary();
                mFileConflictCount      = 0;
                mDirectoryConflictCount = 0;
                return;
            }

            mChangesSummary = MergeTreeResultParser.
                              GetChangesToApplySummary(resultConflicts);

            mFileConflictCount = MergeTreeResultParser.GetUnsolvedFileConflictsCount(
                resultConflicts, rootMountPoint.Id, solvedFileConflicts);

            mDirectoryConflictCount = MergeTreeResultParser.GetUnsolvedDirectoryConflictsCount(
                resultConflicts);
        }
Example #3
0
        void UpdateChangesOverview()
        {
            if (mResultConflicts == null || mRootMountPoint == null)
            {
                return;
            }

            mModifiedCount = 0;
            mModifiedSize  = 0;
            foreach (FileConflict modified in mResultConflicts.FilesModifiedOnSource)
            {
                if (modified.Src.RevInfo == null)
                {
                    continue;
                }

                mModifiedCount++;
                mModifiedSize += modified.Src.RevInfo.Size;
            }

            mAddedCount = 0;
            mAddedSize  = 0;
            foreach (DiffChanged added in mResultConflicts.AddsToApply)
            {
                if (added.RevInfo == null)
                {
                    continue;
                }

                if (added.RevInfo.Type == EnumRevisionType.enDirectory)
                {
                    continue;
                }

                mAddedCount++;
                mAddedSize += added.RevInfo.Size;
            }

            mDeletedCount = 0;
            mDeletedSize  = 0;
            foreach (DiffChanged deleted in mResultConflicts.DeletesToApply)
            {
                if (deleted.RevInfo == null)
                {
                    continue;
                }

                if (deleted.RevInfo.Type == EnumRevisionType.enDirectory)
                {
                    continue;
                }

                mDeletedCount++;
                mDeletedSize += deleted.RevInfo.Size;
            }

            mFileConflictCount = MergeTreeResultParser.GetUnsolvedFileConflictsCount(
                mResultConflicts, mRootMountPoint.Id, mSolvedFileConflicts);

            mDirectoryConflictCount = MergeTreeResultParser.GetUnsolvedDirectoryConflictsCount(
                mResultConflicts);
        }