コード例 #1
0
        public IList <RevisionInternal> GetRevisionHistory(RevisionInternal rev, ICollection <string> ancestorRevIds)
        {
            var history = new List <RevisionInternal>();

            WithC4Document(rev.GetDocId(), rev.GetRevId(), false, false, doc =>
            {
                var enumerator = new CBForestHistoryEnumerator(doc, false);
                foreach (var next in enumerator)
                {
                    if (ancestorRevIds != null && ancestorRevIds.Contains((string)next.SelectedRev.revID))
                    {
                        break;
                    }

                    var newRev = new RevisionInternal(next.GetDocument(), false);
                    newRev.SetMissing(!Native.c4doc_hasRevisionBody(next.GetDocument()));
                    history.Add(newRev);
                }
            });

            return(history);
        }