Beispiel #1
0
 IncomingChangeInfo BuildChangeInfo(MountPointId mountId, long itemId)
 {
     return(new IncomingChangeInfo(
                new MountPointWithPath(
                    mountId,
                    new RepositorySpec(),
                    "/"),
                BuildFileConflict(itemId),
                IncomingChangesCategory.Type.FileConflicts));
 }
Beispiel #2
0
        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");
        }
Beispiel #3
0
        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");
        }
Beispiel #4
0
        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");
        }
Beispiel #5
0
        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");
        }
Beispiel #6
0
        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");
        }
Beispiel #7
0
        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");
        }
Beispiel #8
0
        IncomingChangeInfo BuildFileConflict(MountPointId mountPointId, long itemId)
        {
            DiffChanged src = new DiffChanged(
                CreateFileRevision(itemId), -1, "foo.c", -1,
                Difference.DiffNodeStatus.Changed);

            DiffChanged dst = new DiffChanged(
                CreateFileRevision(itemId), -1, "foo.c", -1,
                Difference.DiffNodeStatus.Changed);

            return(new IncomingChangeInfo(
                       new MountPointWithPath(
                           mountPointId,
                           new RepositorySpec(),
                           "/"),
                       new FileConflict(src, dst),
                       IncomingChangesCategory.Type.FileConflicts));
        }
Beispiel #9
0
        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");
        }