예제 #1
0
 /// <summary>Performs the merge.</summary>
 /// <remarks>Performs the merge.</remarks>
 /// <param name="base">base version of the note tree</param>
 /// <param name="ours">ours version of the note tree</param>
 /// <param name="theirs">theirs version of the note tree</param>
 /// <returns>merge result as a new NoteMap</returns>
 /// <exception cref="System.IO.IOException">System.IO.IOException</exception>
 public virtual NoteMap Merge(NoteMap @base, NoteMap ours, NoteMap theirs)
 {
     try
     {
         InMemoryNoteBucket mergedBucket = Merge(0, @base.GetRoot(), ours.GetRoot(), theirs
                                                 .GetRoot());
         inserter.Flush();
         return(NoteMap.NewMap(mergedBucket, reader));
     }
     finally
     {
         reader.Release();
         inserter.Release();
     }
 }
예제 #2
0
 public override void SetUp()
 {
     base.SetUp();
     tr           = new TestRepository <Repository>(db);
     reader       = db.NewObjectReader();
     inserter     = db.NewObjectInserter();
     noRoot       = NoteMap.NewMap(null, reader);
     empty        = NoteMap.NewEmptyMap();
     noteAId      = tr.Blob("a");
     noteAContent = "noteAContent";
     noteABlob    = tr.Blob(noteAContent);
     sampleTree_a = tr.Commit().Add(noteAId.Name, noteABlob).Create();
     tr.ParseBody(sampleTree_a);
     map_a          = NoteMap.Read(reader, sampleTree_a);
     noteBId        = tr.Blob("b");
     noteBContent   = "noteBContent";
     noteBBlob      = tr.Blob(noteBContent);
     sampleTree_a_b = tr.Commit().Add(noteAId.Name, noteABlob).Add(noteBId.Name, noteBBlob
                                                                   ).Create();
     tr.ParseBody(sampleTree_a_b);
     map_a_b = NoteMap.Read(reader, sampleTree_a_b);
 }