Re: [viewvc-dev] [PATCH] vclib change to limit results in subversion log retrieval
Michael Brailsford <[email protected]>
| Newsgroups | gmane.comp.version-control.cvs.viewcvs.devel |
|---|---|
| Message-ID | <[email protected]> |
I forgot to mention that I made this patch against the the 1.0.4 tag [1]. [1] http://viewvc.tigris.org/source/browse/viewvc/tags/1.0.4/lib/vclib/ -Michael ----- Original Message ---- > From: Michael Brailsford <[email protected]> > To: [email protected] > Sent: Friday, November 30, 2007 3:23:55 PM > Subject: [viewvc-dev] [PATCH] vclib change to limit results in subversion log retrieval > > The intent of this change is to limit the number of items returned > from > fetch_log. This reduces the size of the data set returned. > As > already pointed out, I did not know about the pagination logic when I > did > this. I originally trimmed the history after this function returns, > but > the speedup was not realized until I added the array slice here, > which > is probably due to the sorting. If options does not contain a > num_revs > item, then (I think) the array slice will return the whole > array, > thereby keeping this change passive with the previous version. > > --- viewvc_1_0_4/lib/vclib/svn/__init__.py > 2007-11-29 > 16:46:29.000000000 -0600 > +++ viewvc/lib/vclib/svn/__init__.py 2007-11-12 > 16:45:04.000000000 > -0600 > @@ -364,7 +364,8 @@ > revs.append(rev) > else: > history_set = _get_history(svnrepos, full_name, > which_rev, > options) > - history_revs = history_set.keys() > + nrevs = int(options.get('num_revs')) + 1 > + history_revs = history_set.keys()[-nrevs:-1] > history_revs.sort() > history_revs.reverse() > subpool = core.svn_pool_create(pool) > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [email protected] > For additional commands, e-mail: [email protected] > > --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]