当前位置: 首页>>代码示例>>C#>>正文


C# RepositorySetup.SyncWithOptions方法代码示例

本文整理汇总了C#中LibChorus.TestUtilities.RepositorySetup.SyncWithOptions方法的典型用法代码示例。如果您正苦于以下问题:C# RepositorySetup.SyncWithOptions方法的具体用法?C# RepositorySetup.SyncWithOptions怎么用?C# RepositorySetup.SyncWithOptions使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在LibChorus.TestUtilities.RepositorySetup的用法示例。


在下文中一共展示了RepositorySetup.SyncWithOptions方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: BasicCommitHasCommitFileButNotMergeFile

		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);
			}
		}
开发者ID:JessieGriffin,项目名称:chorus,代码行数:21,代码来源:SychronizerAdjunctTests.cs

示例2: FileDeletedRemotelyAndChangedLocallyKeepsChanged

 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']");
         }
     }
 }
开发者ID:regnrand,项目名称:chorus,代码行数:21,代码来源:HgWrappingTests.cs


注:本文中的LibChorus.TestUtilities.RepositorySetup.SyncWithOptions方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。