示例#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(
            string parentPathname, string childPathname,
            IMergeEventListener listener,
            string firstElementMarker,
            string recordMarker, string identfierAttribute)
        {
            var changeAndConflictAccumulator = listener ?? new ChangeAndConflictAccumulator();
            var differ = Xml2WayDiffer.CreateFromFiles(
                parentPathname, childPathname,
                changeAndConflictAccumulator,
                firstElementMarker,
                recordMarker, identfierAttribute);

            differ.ReportDifferencesToListener();

            return(changeAndConflictAccumulator is ChangeAndConflictAccumulator
                                        ? ((ChangeAndConflictAccumulator)changeAndConflictAccumulator).Changes
                                        : null); // unit tests use impl class that has no "Changes" property.
        }
示例#2
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);
        }