public override Snapshot getBranch(string branch, long limit) { Snapshot sn = null; /* get the last x changesets from tfs. */ TFSDB db = TFSDB.QueryHistory(_vcs, branch, (ulong)limit, null, _cache); { string[] bs = branches(); db.visitor.primeBranches(bs); } /* copy stuff we've already seen from the db cache into the visitor cache. * this only does the top-level stuff * any further queries we get will be passed to the cache. */ foreach (Changeset cs in db.history) { Revision rev = _cache.rev(TFSDB.MakeID(cs.ChangesetId)); if (rev != null) { db.visitor.addRevision(rev); } } /* prime the merge history querying. * this will take out all top-level queries which have already been done. * already been done = exists in cache. * * this will also query tfs for the merge info. */ db.queryMerges(); /* at this point, ALL the changesets in 'history' MUST be in the visitor. * if not, then there's a problem with: * insertQueries or the QueryProcessor. */ /* this adds in the branch's history to the parent lists of the * appropriate changesets. * this will also update the cache */ db.fixHistory(); /* now dump everything in the visitor to the cache. */ db.visitor.save(_cache); db = null; /* the full list should be in the cache now. */ sn = _cache.getBranch(branch, (ulong)limit); return(sn); }
public override Snapshot getBranch(string branch, long limit) { return(_db.getBranch(branch, (ulong)limit)); }