/// <param name="local"></param> /// <param name="inCore"></param> protected internal ResolveMerger(Repository local, bool inCore) : base(local) { DiffAlgorithm.SupportedAlgorithm diffAlg = local.GetConfig().GetEnum(ConfigConstants .CONFIG_DIFF_SECTION, null, ConfigConstants.CONFIG_KEY_ALGORITHM, DiffAlgorithm.SupportedAlgorithm .HISTOGRAM); mergeAlgorithm = new MergeAlgorithm(DiffAlgorithm.GetAlgorithm(diffAlg)); commitNames = new string[] { "BASE", "OURS", "THEIRS" }; this.inCore = inCore; if (inCore) { dircache = DirCache.NewInCore(); } }
/// <param name="alg"> /// the diff algorithm for which an implementation should be /// returned /// </param> /// <returns>an implementation of the specified diff algorithm</returns> public static DiffAlgorithm GetAlgorithm(DiffAlgorithm.SupportedAlgorithm alg) { switch (alg) { case DiffAlgorithm.SupportedAlgorithm.MYERS: { return(MyersDiff <RawText> .INSTANCE); } case DiffAlgorithm.SupportedAlgorithm.HISTOGRAM: { return(new HistogramDiff()); } default: { throw new ArgumentException(); } } }