Re: [viewvc-dev] [PATCH] Hide query link (and RSS feeds) when database does not have the root
"Larry Shatzer, Jr." <[email protected]>
| Newsgroups | gmane.comp.version-control.cvs.viewcvs.devel |
|---|---|
| Message-ID | <[email protected]> |
On Thu, Jun 19, 2008 at 11:11 AM, C. Michael Pilato <[email protected]> wrote: > Larry Shatzer, Jr. wrote: > >> We have quite a few CVS and Subversion repository roots, and not all have >> their information in the query database. To avoid confusion, I have modified >> my local install of ViewVC to hide the query link (and RSS feeds) for >> repository roots that do not have the database backing them. If needed, I >> can create an issue and post this there instead. >> > > Larry, thanks for tackling this. I've been bothered by this situation, too > (just apparently not bothered enough to fix it). > I guess your itch was not as big as mine. :) I like the general approach you've taken, but would make some suggestions: > > First, rather than adding a 'querydb_populated' data dictionary item, just > set the existing 'queryform_href' and 'rss_href' items to None if, due to > the commits database not being populated for the relevant roots, those links > would take a user to an errorful page anyway. In doing so, you avoid adding > yet another few bytes to the data dictionary, but more importantly, you keep > the template logic simpler (and I suspect unchanged entirely). > Makes sense, I was just going for, at the time, the easiest change, but did not even consider that option. Thanks! Secondly, it appears (by visual inspection, anyway) that your patch would > raise an exception on installations where the commits database isn't > configured for use at all in viewvc.conf. > Before I reverted and made my new changes and I tested it, and did not see any errors for a unconfigured database. (I just switched the flag from 1 to 0). Care to address these issues and resubmit the patch? Thanks! > > (By the way, I've filed issue #357 to track this.) > I have updated the issue with a new patch, and it is much simpler now, and only changes to viewvc.py -- Larry