private void CheckBothWaysNoConflicts(string red, string blue, string ancestor, params string[] xpaths) { ChangeAndConflictAccumulator r = CheckOneWay(red, blue, ancestor, xpaths); AssertNoConflicts(r); r = CheckOneWay(blue, red, ancestor, xpaths); AssertNoConflicts(r); }
private static void AssertNoConflicts(ChangeAndConflictAccumulator r) { if (r.Conflicts.Count > 0) { foreach (IConflict conflict in r.Conflicts) { Console.WriteLine("*Unexpected: " + conflict.GetFullHumanReadableDescription()); } } Assert.AreEqual(0, r.Conflicts.Count, "There were unexpected conflicts."); }
/// <summary> /// Report the differences between two versions of files in the repository. /// </summary> /// <returns>Zero or more change reports.</returns> public static IEnumerable <IChangeReport> ReportDifferences(HgRepository repository, FileInRevision parent, FileInRevision child, string firstElementMarker, string recordMarker, string identfierAttribute) { var changeAndConflictAccumulator = new ChangeAndConflictAccumulator(); // Pulls the files out of the repository so we can read them. var differ = Xml2WayDiffer.CreateFromFileInRevision( parent, child, changeAndConflictAccumulator, repository, firstElementMarker, recordMarker, identfierAttribute); differ.ReportDifferencesToListener(); return(changeAndConflictAccumulator.Changes); }