Add autourl support for multidir.
Fri Jul 14 19:27:30 UTC 2006 Alberto Bertogli <albertogli@telpin.com.ar>
* Add autourl support for multidir.
This patch adds a new option for multidir config entries, named "autourl". If
set, it will take the contents of "_darcs/third_party/darcsweb/url" and use it
as repourl.
Thanks to Marco Baringer for suggestion and preliminary patch.
diff -rN -u old-darcsweb/config.py.sample new-darcsweb/config.py.sample
--- old-darcsweb/config.py.sample 2014-04-12 23:26:17.000000000 +0000
+++ new-darcsweb/config.py.sample 2014-04-12 23:26:17.000000000 +0000
@@ -135,4 +135,8 @@
# True. It defaults to False.
#autoexclude = True
+ # if you want urls to be picked up automatically from the file named
+ # "_darcs/third_party/darcsweb/url" (one line only), set this to
+ # True. It defaults to False.
+ #autourl = True
diff -rN -u old-darcsweb/darcsweb.cgi new-darcsweb/darcsweb.cgi
--- old-darcsweb/darcsweb.cgi 2014-04-12 23:26:17.000000000 +0000
+++ new-darcsweb/darcsweb.cgi 2014-04-12 23:26:17.000000000 +0000
@@ -2185,8 +2185,17 @@
else:
desc = c.repodesc % { 'name': name }
+ if 'autourl' in dir(c) and c.autourl:
+ dpath = fulldir + \
+ '/_darcs/third_party/darcsweb/url'
+ if os.access(dpath, os.R_OK):
+ url = open(dpath).read()
+ else:
+ url = c.repourl % { 'name': name }
+ else:
+ url = c.repourl % { 'name': name }
+
rdir = fulldir
- url = c.repourl % { 'name': name }
class tmp_config:
reponame = name
repodir = rdir