Example #1
0
        /// <exception cref="System.IO.IOException"></exception>
        private string Merge(string commonBase, string ours, string theirs)
        {
            MergeResult <RawText> r = new MergeAlgorithm().Merge(RawTextComparator.DEFAULT, RT(commonBase
                                                                                               ), RT(ours), RT(theirs));
            ByteArrayOutputStream bo = new ByteArrayOutputStream(50);

            fmt.FormatMerge(bo, r, "B", "O", "T", Constants.CHARACTER_ENCODING);
            return(Sharpen.Runtime.GetStringForBytes(bo.ToByteArray(), Constants.CHARACTER_ENCODING
                                                     ));
        }
Example #2
0
 /// <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();
     }
 }