Esempio n. 1
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;
        }
Esempio n. 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.");
 }