Exemplo n.º 1
0
        /// <summary>Set the repository the formatter can load object contents from.</summary>
        /// <remarks>
        /// Set the repository the formatter can load object contents from.
        /// Once a repository has been set, the formatter must be released to ensure
        /// the internal ObjectReader is able to release its resources.
        /// </remarks>
        /// <param name="repository">source repository holding referenced objects.</param>
        public virtual void SetRepository(Repository repository)
        {
            if (reader != null)
            {
                reader.Release();
            }
            db     = repository;
            reader = db.NewObjectReader();
            ContentSource cs = ContentSource.Create(reader);

            source = new ContentSource.Pair(cs, cs);
            DiffConfig dc = db.GetConfig().Get(DiffConfig.KEY);

            if (dc.IsNoPrefix())
            {
                SetOldPrefix(string.Empty);
                SetNewPrefix(string.Empty);
            }
            SetDetectRenames(dc.IsRenameDetectionEnabled());
            diffAlgorithm = DiffAlgorithm.GetAlgorithm(db.GetConfig().GetEnum(ConfigConstants
                                                                              .CONFIG_DIFF_SECTION, null, ConfigConstants.CONFIG_KEY_ALGORITHM, DiffAlgorithm.SupportedAlgorithm
                                                                              .HISTOGRAM));
        }
Exemplo n.º 2
0
 /// <summary>Set the algorithm used when there are too many element occurrences.</summary>
 /// <remarks>Set the algorithm used when there are too many element occurrences.</remarks>
 /// <param name="alg">
 /// the secondary algorithm. If null the region will be denoted as
 /// a single REPLACE block.
 /// </param>
 public virtual void SetFallbackAlgorithm(DiffAlgorithm alg)
 {
     fallback = alg;
 }
Exemplo n.º 3
0
 /// <summary>Set the algorithm that constructs difference output.</summary>
 /// <remarks>Set the algorithm that constructs difference output.</remarks>
 /// <param name="alg">the algorithm to produce text file differences.</param>
 /// <seealso cref="HistogramDiff">HistogramDiff</seealso>
 public virtual void SetDiffAlgorithm(DiffAlgorithm alg)
 {
     diffAlgorithm = alg;
 }