new optional config varuable: disable_annotate
darcsweb.cgi
Fri Mar 16 19:27:14 UTC 2007 VMiklos <vmiklos@frugalware.org>
* new optional config varuable: disable_annotate
* the annotate feature is still enabled by default
* this can be useful on slow machines
--- old-darcsweb/darcsweb.cgi 2015-09-05 11:17:23.000000000 +0000
+++ new-darcsweb/darcsweb.cgi 2015-09-05 11:17:23.000000000 +0000
@@ -1036,7 +1036,10 @@
if hash:
cmd += ' --match="hash %s"' % hash
cmd += ' "%s"' % fname
- out = run_darcs(cmd)
+ if not config.disable_annotate:
+ out = run_darcs(cmd)
+ else:
+ return None
return parse_annotate(out)
@@ -1851,6 +1854,13 @@
def do_annotate(fname, phash, style):
print_header()
ann = get_annotate(fname, phash)
+ if not ann:
+ print """
+<i>The annotate feature has been disabled</i>
+</div>
+ """
+ print_footer()
+ return
print_navbar(f = fname, h = ann.lastchange_hash)
print """
@@ -2371,6 +2381,10 @@
config.author_links = base.author_links
else:
config.author_links = None
+ if "disable_annotate" in dir(base):
+ config.disable_annotate = base.disable_annotate
+ else:
+ config.disable_annotate = False