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); }
public static bool Conflict( IncomingChangeInfo changeInfo, IncomingChangeInfo metaChangeInfo, MergeSolvedFileConflicts solvedFileConflicts) { if (IsDirectoryConflict(changeInfo)) { if (metaChangeInfo == null) { return(IsDirectoryConflictResolved(changeInfo)); } return(IsDirectoryConflictResolved(changeInfo) && IsDirectoryConflictResolved(metaChangeInfo)); } if (metaChangeInfo == null) { return(IsFileConflictResolved( changeInfo, solvedFileConflicts)); } return(IsFileConflictResolved(changeInfo, solvedFileConflicts) && IsFileConflictResolved(metaChangeInfo, solvedFileConflicts)); }
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); }
public void NotCurrentConflictTest() { long itemId = 55; MountPointId mountPointId = MountPointId.WORKSPACE_ROOT; MergeChangeInfo changeInfo = BuildChangeInfo(mountPointId, itemId); MergeSolvedFileConflicts solvedFileConflicts = new MergeSolvedFileConflicts(); Assert.IsFalse( IsCurrent.Conflict(changeInfo, null, solvedFileConflicts), "Should return false"); }
static bool IsFileConflictResolved( IncomingChangeInfo changeInfo, MergeSolvedFileConflicts solvedFileConflicts) { if (solvedFileConflicts == null) { return(false); } return(solvedFileConflicts.IsResolved( changeInfo.GetMount().Id, changeInfo.GetRevision().ItemId)); }
public void IsFileConflictNotResolved() { long itemId = 55; MountPointId mountPointId = MountPointId.WORKSPACE_ROOT; MergeChangeInfo fileConflict = BuildFileConflict(mountPointId, itemId); MergeSolvedFileConflicts solvedFileConflicts = new MergeSolvedFileConflicts(); Assert.IsFalse( IsSolved.Conflict(fileConflict, null, solvedFileConflicts), "Conflict shouldn't be resolved"); }
public void IsFileConflictResolved() { long itemId = 55; MountPointId mountPointId = MountPointId.WORKSPACE_ROOT; IncomingChangeInfo fileConflict = BuildFileConflict(mountPointId, itemId); MergeSolvedFileConflicts solvedFileConflicts = new MergeSolvedFileConflicts(); solvedFileConflicts.AddResolveFile(mountPointId, itemId, "foo.c"); Assert.IsTrue( IsSolved.Conflict(fileConflict, null, solvedFileConflicts), "Conflict should be resolved"); }
static void DoFileConflictsArea( IncomingChangesTreeView incomingChangesTreeView, MergeTreeResult conflicts, MergeSolvedFileConflicts solvedConflicts, MountPointWithPath mount, bool isOperationRunning) { DoConflictsHeader( conflicts, solvedConflicts, mount); DoConflictsTree( incomingChangesTreeView, isOperationRunning); }
public void NotCurrentConflictWithMeta() { long itemId = 55; long metaItemId = 66; MountPointId mountPointId = MountPointId.WORKSPACE_ROOT; IncomingChangeInfo changeInfo = BuildChangeInfo(mountPointId, itemId); IncomingChangeInfo metaChangeInfo = BuildChangeInfo(mountPointId, metaItemId); MergeSolvedFileConflicts solvedFileConflicts = new MergeSolvedFileConflicts(); Assert.IsFalse( IsCurrent.Conflict(changeInfo, metaChangeInfo, solvedFileConflicts), "Should return false"); }
public void CurrentConflictTest() { long itemId = 55; MountPointId mountPointId = MountPointId.WORKSPACE_ROOT; MergeChangeInfo changeInfo = BuildChangeInfo(mountPointId, itemId); MergeSolvedFileConflicts solvedFileConflicts = new MergeSolvedFileConflicts(); MergeSolvedFileConflicts.CurrentConflict currentConflict = new MergeSolvedFileConflicts.CurrentConflict( mountPointId, itemId, 0); solvedFileConflicts.SetCurrentConflict(currentConflict); Assert.IsTrue( IsCurrent.Conflict(changeInfo, null, solvedFileConflicts), "Should return true"); }
public void IsFileDirectoryConflictWithMetaNotResolved() { long itemId = 55; long metaItemId = 66; MountPointId mountPointId = MountPointId.WORKSPACE_ROOT; MergeChangeInfo fileConflict = BuildFileConflict(mountPointId, itemId); MergeChangeInfo metaFileConflict = BuildFileConflict(mountPointId, metaItemId); MergeSolvedFileConflicts solvedFileConflicts = new MergeSolvedFileConflicts(); solvedFileConflicts.AddResolveFile(mountPointId, itemId, "foo.c"); Assert.IsFalse( IsSolved.Conflict(fileConflict, metaFileConflict, solvedFileConflicts), "Conflict shouldn't be resolved"); }
internal static bool Conflict( IncomingChangeInfo changeInfo, IncomingChangeInfo metaChangeInfo, MergeSolvedFileConflicts solvedFileConflicts) { if (solvedFileConflicts == null) { return(false); } MergeSolvedFileConflicts.CurrentConflict currentConflict; if (!solvedFileConflicts.TryGetCurrentConflict(out currentConflict)) { return(false); } return(IsSameConflict(currentConflict, changeInfo) || IsSameConflict(currentConflict, metaChangeInfo)); }
public void CurrentConflictWithMetaCurrentIsNotTheMeta() { long itemId = 55; long metaItemId = 66; MountPointId mountPointId = MountPointId.WORKSPACE_ROOT; MergeChangeInfo changeInfo = BuildChangeInfo(mountPointId, itemId); MergeChangeInfo metaChangeInfo = BuildChangeInfo(mountPointId, metaItemId); MergeSolvedFileConflicts solvedFileConflicts = new MergeSolvedFileConflicts(); MergeSolvedFileConflicts.CurrentConflict currentConflict = new MergeSolvedFileConflicts.CurrentConflict( mountPointId, itemId, 0); solvedFileConflicts.SetCurrentConflict(currentConflict); Assert.IsTrue( IsCurrent.Conflict(changeInfo, metaChangeInfo, solvedFileConflicts), "Should return true"); }
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()); }
static void DoConflictsHeader( MergeTreeResult conflicts, MergeSolvedFileConflicts solvedFileConflicts, MountPointWithPath mount) { if (conflicts == null || mount == null) { return; } EditorGUILayout.BeginHorizontal(); DoDirectoryConflictsHeader(conflicts); DoFileConflictsHeader( conflicts, solvedFileConflicts, mount); GUILayout.FlexibleSpace(); EditorGUILayout.EndHorizontal(); }
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); }
internal void UpdateSolvedFileConflicts( MergeSolvedFileConflicts solvedFileConflicts) { mSolvedFileConflicts = solvedFileConflicts; }
void MergeViewLogic.IMergeView.UpdateSolvedFileConflicts( MergeSolvedFileConflicts solvedFileConflicts) { mIncomingChangesTreeView.UpdateSolvedFileConflicts( solvedFileConflicts); }