public void BasicCommitHasCommitFileButNotMergeFile()
		{
			using (var bob = new RepositorySetup("bob", true))
			{
				var syncAdjunct = new FileWriterSychronizerAdjunct(bob.RootFolder.Path);
				CheckNoFilesExist(syncAdjunct);

				var options = new SyncOptions
				{
					DoMergeWithOthers = false,
					DoPullFromOthers = false,
					DoSendToOthers = false
				};
				var synchronizer = bob.CreateSynchronizer();
				synchronizer.SynchronizerAdjunct = syncAdjunct;

				var syncResults = bob.SyncWithOptions(options, synchronizer);
				Assert.IsFalse(syncResults.DidGetChangesFromOthers);
				CheckExistanceOfAdjunctFiles(syncAdjunct, true, false, false, false, true, false);
			}
		}
Beispiel #2
0
 public void FileDeletedRemotelyAndChangedLocallyKeepsChanged()
 {
     using(var localRepo = new RepositorySetup("unbundleTests"))
     {
         var localFilePath = localRepo.ProjectFolder.GetNewTempFile(true).Path;
         localRepo.AddAndCheckinFile(localFilePath, "file to change and delete");
         using(var remoteRepo = new RepositorySetup("remote", localRepo))
         {
             remoteRepo.CheckinAndPullAndMerge();
             var remoteFilePath = Path.Combine(remoteRepo.ProjectFolder.Path, Path.GetFileName(localFilePath));
             remoteRepo.ChangeFileAndCommit(remoteFilePath, "new contents", "changed file");
             File.Delete(localFilePath);
             localRepo.SyncWithOptions(new SyncOptions { CheckinDescription = "delete file", DoMergeWithOthers = false, DoPullFromOthers = false, DoSendToOthers = false });
             localRepo.CheckinAndPullAndMerge(remoteRepo);
             Assert.That(File.Exists(localFilePath), Is.True, "Did not keep changed file.");
             var chorusNotesPath = localFilePath + ".ChorusNotes";
             Assert.That(File.Exists(chorusNotesPath), "Did not record conflict");
             AssertThatXmlIn.File(chorusNotesPath).HasAtLeastOneMatchForXpath("//annotation[@class='mergeconflict']");
         }
     }
 }