Mon Jul 25 04:41:00 UTC 2005 Alberto Bertogli <albertogli@telpin.com.ar>
* Skip showing the tree link if there is no pristine tree.
If the repository was get with the --no-pristine-tree option, there won't be a
current directory; we only show the tree option if the directory is there.
The other related option that accesses the pristine tree directly is the
headblob, but there is already a check in place that takes care of it.
Thanks to Stephane Popinet for reporting it.
diff -rN -u old-darcsweb/darcsweb.cgi new-darcsweb/darcsweb.cgi
--- old-darcsweb/darcsweb.cgi 2015-10-27 06:30:24.000000000 +0000
+++ new-darcsweb/darcsweb.cgi 2015-10-27 06:30:24.000000000 +0000
@@ -245,9 +245,14 @@
<a href="%(myreponame)s;a=summary">summary</a>
| <a href="%(myreponame)s;a=shortlog">shortlog</a>
| <a href="%(myreponame)s;a=log">log</a>
-| <a href="%(myreponame)s;a=tree">tree</a>
""" % { "myreponame": config.myreponame }
+ if os.path.isdir(config.repodir + '/_darcs/current/'):
+ # the current directory is missing if the --no-pristine-tree
+ # option was used in darcs get, so we only show the link if
+ # the directory exists
+ print '| <a href="%s;a=tree">tree</a>' % config.myreponame
+
if h:
print """
| <a href="%(myreponame)s;a=commit;h=%(hash)s">commit</a>