public void StartMerge_RepoWithMergeConflict_ReturnsMergeJobThatHasConflicts() { CreateRepositoryWithMergeConflicts(); try { MergeJob job = Repo.StartMerge(); Assert.That(job.State, Is.EqualTo(MergeJobState.HasUnresolvedConflicts)); } catch (NotSupportedException) { Assert.Inconclusive("Merge tool not supported in this version"); } }
public void Commit_WithUnresolvedConflicts_ThrowsInvalidOperationException() { CreateRepositoryWithMergeConflicts(); try { MergeJob job = Repo.StartMerge(); Assert.Throws <InvalidOperationException>(() => job.Commit("merged")); } catch (NotSupportedException) { Assert.Inconclusive("Merge tool not supported in this version"); } }
/// <summary> /// Initializes a new instance of the <see cref="MergeJobConflict"/> class. /// </summary> /// <param name="mergeJob"> /// The <see cref="MergeJob"/> that manages this <see cref="MergeJobConflict"/>. /// </param> /// <param name="path"> /// The name of the file this <see cref="MergeJobConflict"/> relates to. /// </param> /// <param name="state"> /// The initial state of the file. /// </param> /// <exception cref="System.ArgumentNullException"> /// <para><paramref name="mergeJob"/> is <c>null</c>.</para> /// <para>- or -</para> /// <para><paramref name="path"/> is <c>null</c> or empty.</para> /// </exception> public MergeJobConflict(MergeJob mergeJob, string path, MergeConflictState state) { if (mergeJob == null) { throw new ArgumentNullException("mergeJob"); } if (StringEx.IsNullOrWhiteSpace(path)) { throw new ArgumentNullException("path"); } _MergeJob = mergeJob; _Path = path; State = state; }
public void Parents_InAMerge_HasCorrectValues() { CreateRepositoryWithoutMergeConflicts(); try { MergeJob job = Repo.StartMerge(); Assert.That(job.LocalParent.RevisionNumber, Is.EqualTo(2)); Assert.That(job.OtherParent.RevisionNumber, Is.EqualTo(1)); } catch (NotSupportedException) { Assert.Inconclusive("Merge tool not supported in this version"); } }
public void StartMerge_RepoWithMergeConflict_ReturnsMergeJobThatListsTheConflictingFile() { CreateRepositoryWithMergeConflicts(); try { MergeJob job = Repo.StartMerge(); CollectionAssert.AreEqual( new[] { new MergeJobConflict(job, "dummy.txt", MergeConflictState.Unresolved), }, job.UnresolvedConflicts); } catch (NotSupportedException) { Assert.Inconclusive("Merge tool not supported in this version"); } }
public void ResolveConflictThroughMerge_MarksFileAsResolved() { CreateRepositoryWithMergeConflicts(); MergeJob job = null; try { job = Repo.StartMerge(); } catch (NotSupportedException) { Assert.Inconclusive("Merge tool not supported in this version"); } job.UnresolvedConflicts.First().Resolve(new ResolveCommand().WithMergeTool(MergeTools.InternalLocal)); Assert.That(job.State, Is.EqualTo(MergeJobState.ReadyToCommit)); }
private async void PerformJob() { var isNative = ShouldUseNativeBackend(); // Clear log textLog.Clear(); // Create directory ahead of time Directory.CreateDirectory(textOutput.Text); IMkvJobMerger mergeStrategy; var logger = new TextBoxControlWriter(this, textLog); if (isNative) { mergeStrategy = new MergeJob(new MergeOptions()); Console.SetOut(logger); } else { mergeStrategy = new PerlJob(GetCommandLineArguments()); } var sourcePath = textInput.Text; var files = Directory.GetFiles(sourcePath); foreach (var file in files) { var result = mergeStrategy.ExecuteJob(logger, file, textOutput.Text); } // End the job ExecuteSecure(() => MessageBox.Show("The unlinking is complete!", "Complete", MessageBoxButtons.OK, MessageBoxIcon.Information)); buttonExecute.Enabled = true; buttonAbort.Enabled = false; }