public void Sync_FileLockedForWritingDuringUpdate_GetUpdatedFileOnceLockIsGone() { HgRunner.TimeoutSecondsOverrideForUnitTests = 3; using (var bob = new RepositorySetup("bob")) { bob.ProjectFolderConfig.IncludePatterns.Add("*.txt"); bob.AddAndCheckinFile("one.txt", "hello"); using (var sally = new RepositorySetup("sally", bob)) { bob.AddAndCheckinFile("one.txt", "hello-bob"); using (sally.GetFileLockForWriting("one.txt")) { // Note: Mono succeeds here Assert.That(sally.CheckinAndPullAndMerge(bob).Succeeded, Is.False, "CheckinAndPullAndMerge should have failed"); sally.AssertFileContents("one.txt", "hello"); } sally.AssertSingleHead(); //ok, now whatever was holding that file is done with it, and we try again Assert.That(sally.CheckinAndPullAndMerge(bob).Succeeded, Is.True, "ChecinAndPullAndMerge(bob) should have succeeded"); sally.AssertFileContents("one.txt", "hello-bob"); } } }