Fri Dec 30 23:44:19 UTC 2005 Alberto Bertogli <albertogli@telpin.com.ar>
* Add autodesc and autoexclude options.
This patch implements two optional options for multidir repos: autodesc and
autoexclude.
If autodesc is enabled, the description will be taken from the file named
"_darcs/third_party/darcsweb/desc", inside the repository. If it doesn't
exist, the default will be used.
If autoexclude is enabled, only repositories with a directory named
"_darcs/third_party/darcsweb/" will be listed.
The path "_darcs/third_party/darcsweb/" for darcsweb-exclusive preferences was
chosen following a suggestion by David Roundy in the mail with Subject
"[darcs-users] darcsweb 0.12 and some questions", Message-ID
20051109123238.GB17288@abridgegame.org, date "9 Nov 2005 07:32:44".
{
hunk ./config.py.sample 113
+
+ # if you want the descriptions to be picked up automatically from the
+ # file named "_darcs/third_party/darcsweb/desc" (one line only), set
+ # this to True. It defaults to False
+ #autodesc = True
+
+ # if you want to exclude all the repositories which do NOT have a
+ # directory named "_darcs/third_party/darcsweb/" inside, set this to
+ # True. It defaults to False.
+ #autoexclude = True
hunk ./darcsweb.cgi 2016
+ if 'autoexclude' in dir(c) and c.autoexclude:
+ dpath = fulldir + \
+ '/_darcs/third_party/darcsweb'
+ if not os.path.isdir(dpath):
+ continue
+
+ if 'autodesc' in dir(c) and c.autodesc:
+ dpath = fulldir + \
+ '/_darcs/third_party/darcsweb/desc'
+ if os.access(dpath, os.R_OK):
+ desc = open(dpath).read()
+ else:
+ desc = c.repodesc % { 'name': name }
+ else:
+ desc = c.repodesc % { 'name': name }
+
hunk ./darcsweb.cgi 2033
- desc = c.repodesc % { 'name': name }
}