Beispiel #1
0
        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);
        }
Beispiel #2
0
 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.");
 }
Beispiel #3
0
        /// <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);
        }