Пример #1
0
        /// <exception cref="System.IO.IOException"></exception>
        private NonNoteEntry MergeNonNotes(NonNoteEntry baseList, NonNoteEntry oursList,
                                           NonNoteEntry theirsList)
        {
            if (baseList == null && oursList == null && theirsList == null)
            {
                return(null);
            }
            ObjectId baseId   = Write(baseList);
            ObjectId oursId   = Write(oursList);
            ObjectId theirsId = Write(theirsList);

            inserter.Flush();
            Merger m = nonNotesMergeStrategy.NewMerger(db, true);

            if (m is ThreeWayMerger)
            {
                ((ThreeWayMerger)m).SetBase(baseId);
            }
            if (!m.Merge(oursId, theirsId))
            {
                throw new NotesMergeConflictException(baseList, oursList, theirsList);
            }
            ObjectId            resultTreeId = m.GetResultTreeId();
            AbbreviatedObjectId none         = AbbreviatedObjectId.FromString(string.Empty);

            return(NoteParser.Parse(none, resultTreeId, reader).nonNotes);
        }
Пример #2
0
            /// <exception cref="System.IO.IOException"></exception>
            internal InMemoryNoteBucket Load(AnyObjectId prefix, ObjectReader or)
            {
                AbbreviatedObjectId p    = prefix.Abbreviate(this._enclosing.prefixLen + 2);
                InMemoryNoteBucket  self = NoteParser.Parse(p, this.treeId, or);

                this._enclosing.table[this._enclosing.Cell(prefix)] = self;
                return(self);
            }
        /// <exception cref="NGit.Errors.MissingObjectException"></exception>
        /// <exception cref="NGit.Errors.IncorrectObjectTypeException"></exception>
        /// <exception cref="NGit.Errors.CorruptObjectException"></exception>
        /// <exception cref="System.IO.IOException"></exception>
        private void Load(ObjectId rootTree)
        {
            AbbreviatedObjectId none = AbbreviatedObjectId.FromString(string.Empty);

            root = NoteParser.Parse(none, rootTree, reader);
        }