static void DoDirectoryConflictsHeader(MergeTreeResult conflicts) { int directoryConflictsCount = MergeTreeResultParser.GetDirectoryConflictsCount(conflicts); int pendingDirectoryConflictsCount = MergeTreeResultParser.GetUnsolvedDirectoryConflictsCount( conflicts); if (directoryConflictsCount == 0) { return; } GUIStyle pendingDirectoryConflictsOfTotalStyle = pendingDirectoryConflictsCount > 0 ? UnityStyles.IncomingChangesTab.RedPendingConflictsOfTotalLabel : UnityStyles.IncomingChangesTab.GreenPendingConflictsOfTotalLabel; GUILayout.Label( string.Format("{0}/{1}", pendingDirectoryConflictsCount, directoryConflictsCount), pendingDirectoryConflictsOfTotalStyle); GUILayout.Label( MergeViewTexts.GetDirectoryConflictsUnsolvedCaption(directoryConflictsCount), UnityStyles.IncomingChangesTab.PendingConflictsLabel); }
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); }
void MergeViewLogic.IMergeView.UpdateData( MergeTreeResult resultConflicts, ExplainMergeData explainMergeData, MergeSolvedFileConflicts solvedFileConflicts, MountPointWithPath rootMountPoint, bool isIncomingMerge, bool isMergeTo, bool isUpdateMerge, bool mergeHasFinished) { HideMessage(); ShowProcessMergesButton(MergeViewTexts.GetProcessMergeButtonText( MergeTreeResultParser.GetFileConflictsCount(resultConflicts) > 0, true)); mResultConflicts = resultConflicts; mSolvedFileConflicts = solvedFileConflicts; mRootMountPoint = rootMountPoint; mConflictResolutionStates.Clear(); UpdateFileConflictsTree( IncomingChangesTree.BuildIncomingChangeCategories( mResultConflicts, this, mRootMountPoint), mIncomingChangesTreeView); }
void IIncomingChangesTab.OnGUI() { if (Event.current.type == EventType.Layout) { mHasPendingDirectoryConflicts = MergeTreeResultParser.GetUnsolvedDirectoryConflictsCount(mResultConflicts) > 0; mIsOperationRunning = mProgressControls.IsOperationRunning(); } DoActionsToolbar( mIsProcessMergesButtonVisible, mIsCancelMergesButtonVisible, mIsProcessMergesButtonEnabled, mIsCancelMergesButtonEnabled, mProcessMergesButtonText, mHasPendingDirectoryConflicts, mIsOperationRunning, mPlasticClient, mMergeViewLogic, mProgressControls.ProgressData); DoFileConflictsArea( mPlasticClient, mIncomingChangesTreeView, mResultConflicts, mSolvedFileConflicts, mRootMountPoint, mIsOperationRunning); List <IncomingChangeInfo> selectedIncomingChanges = mIncomingChangesTreeView.GetSelectedIncomingChanges(); if (GetSelectedIncomingChangesGroupInfo.For( selectedIncomingChanges).IsDirectoryConflictsSelection&& !Mouse.IsRightMouseButtonPressed(Event.current)) { DoDirectoryConflictResolutionPanel( selectedIncomingChanges, new Action <IncomingChangeInfo>(ResolveDirectoryConflict), mConflictResolutionStates); } if (mIsMessageLabelVisible) { DoInfoMessageArea(mMessageLabelText); } if (mIsErrorMessageLabelVisible) { DoErrorMessageArea(mErrorMessageLabelText); } if (mProgressControls.HasNotification()) { DrawProgressForViews.ForNotificationArea( mProgressControls.ProgressData); } }
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); }
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); }
void IIncomingChangesTab.OnGUI() { if (Event.current.type == EventType.Layout) { mHasPendingDirectoryConflicts = MergeTreeResultParser.GetUnsolvedDirectoryConflictsCount(mResultConflicts) > 0; mIsOperationRunning = mProgressControls.IsOperationRunning(); } DoConflictsTree( mIncomingChangesTreeView, mIsOperationRunning, mHasNothingToDownload, mIsUpdateSuccessful); List <MergeChangeInfo> selectedIncomingChanges = mIncomingChangesTreeView.GetSelectedIncomingChanges(); if (GetSelectedIncomingChangesGroupInfo.For( selectedIncomingChanges).IsDirectoryConflictsSelection&& !Mouse.IsRightMouseButtonPressed(Event.current)) { DoDirectoryConflictResolutionPanel( selectedIncomingChanges, new Action <MergeChangeInfo>(ResolveDirectoryConflict), mConflictResolutionStates); } DrawActionToolbar.Begin(mParentWindow); if (!mIsOperationRunning) { DoActionToolbarMessage( mIsMessageLabelVisible, mMessageLabelText, mHasNothingToDownload, mIsErrorMessageLabelVisible, mErrorMessageLabelText, mDirectoryConflictCount, mFileConflictCount, mChangesSummary); if (mIsProcessMergesButtonVisible) { DoProcessMergesButton( mIsProcessMergesButtonEnabled && !mHasPendingDirectoryConflicts, mProcessMergesButtonText, mSwitcher, mWorkspaceWindow, mGuiMessage, mMergeViewLogic, AfterProcessMerges); } if (mIsCancelMergesButtonVisible) { mIsCancelMergesButtonEnabled = DoCancelMergesButton( mIsCancelMergesButtonEnabled, mMergeViewLogic); } if (mHasPendingDirectoryConflicts) { GUILayout.Space(5); DoWarningMessage(); } } else { DrawProgressForViews.ForIndeterminateProgress( mProgressControls.ProgressData); } DrawActionToolbar.End(); if (mProgressControls.HasNotification()) { DrawProgressForViews.ForNotificationArea( mProgressControls.ProgressData); } }