Esempio n. 1
0
        public void RenameMergeTest()
        {
            MigrationItemStrings file1 = new MigrationItemStrings(source.Name + "file1.txt", source.Name + "renamed-file1.txt", TestEnvironment, true);

            SourceAdapter.AddFile(file1.LocalPath);

            MigrationItemStrings file2 = new MigrationItemStrings(source.Name + "file2.txt", source.Name + "renamed-file2.txt", TestEnvironment, true);

            SourceAdapter.AddFile(file2.LocalPath);

            int changesetId = AddBranch();

            SourceAdapter.RenameItem(file.ServerPath, file.NewServerPath, AddComment);
            SourceAdapter.RenameItem(file1.ServerPath, file1.NewServerPath, AddComment);
            SourceAdapter.RenameItem(file2.ServerPath, file2.NewServerPath, AddComment);

            SourceWorkspace.Merge(source.LocalPath, target.LocalPath,
                                  VersionSpec.ParseSingleSpec(changesetId.ToString(), Environment.UserName),
                                  VersionSpec.Latest, LockLevel.None, RecursionType.Full, MergeOptions.ForceMerge);

            Conflict[] conflicts = SourceWorkspace.QueryConflicts(new string[] { "$/" }, true);

            foreach (Conflict conflict in conflicts)
            {
                conflict.Resolution = Resolution.AcceptTheirs;
                SourceWorkspace.ResolveConflict(conflict);
            }

            RunAndValidate();
        }
Esempio n. 2
0
 /// <summary>
 /// Resolve all merge conflicts with the specified resolution so that it may be checked in
 /// </summary>
 /// <param name="resolution">resolution to use</param>
 protected void ResolveConflicts(Resolution resolution)
 {
     Conflict[] conflicts = SourceWorkspace.QueryConflicts(new string[] { "$/" }, true);
     foreach (Conflict conflict in conflicts)
     {
         conflict.Resolution = resolution;
         SourceWorkspace.ResolveConflict(conflict);
     }
 }
Esempio n. 3
0
        private void resolveConflictAcceptThiers()
        {
            Conflict[] conflicts = SourceWorkspace.QueryConflicts(new string[] { "$/" }, true);

            foreach (Conflict c in conflicts)
            {
                c.Resolution = Resolution.AcceptTheirs;
                SourceWorkspace.ResolveConflict(c);
            }
        }