Add an option to change the display name of the repository
Thu Mar 27 01:02:58 UTC 2008 Alberto Bertogli <albertito@gmail.com>
* Add an option to change the display name of the repository
It can be used to avoid clashes in multidir entries.
Thanks to Dan Muller for the idea and alternative implementation.
{
hunk ./config.py.sample 147
-# "%(name)s" gets expanded to the it.
+# "%(name)s" gets expanded to the it. If displayname is set, "%(dname)s" gets
+# expanded to it; otherwise it's the same as "%(name)s".
hunk ./config.py.sample 164
+ # if you want to change the display name of the repositories (i.e. the
+ # name it will have on the listings, urls, etc.), you can set it here.
+ # You can use "%(name)s" expansion, see above.
+ #displayname = "local/%(name)s"
+
hunk ./darcsweb.cgi 2249
+ # set the display name at the beginning, so it can be
+ # used by the other replaces
+ if 'displayname' in dir(c):
+ dname = c.displayname % { 'name': name }
+ else:
+ dname = name
+
+ rep_dict = { 'name': name, 'dname': dname }
+
hunk ./darcsweb.cgi 2270
- desc = c.repodesc % { 'name': name }
+ desc = c.repodesc % rep_dict
hunk ./darcsweb.cgi 2272
- desc = c.repodesc % { 'name': name }
+ desc = c.repodesc % rep_dict
hunk ./darcsweb.cgi 2280
- url = c.repourl % { 'name': name }
+ url = c.repourl % rep_dict
hunk ./darcsweb.cgi 2282
- url = c.repourl % { 'name': name }
+ url = c.repourl % rep_dict
hunk ./darcsweb.cgi 2290
- projurl = c.repoprojurl % {'name': name}
+ projurl = c.repoprojurl % rep_dict
hunk ./darcsweb.cgi 2294
- projurl = c.repoprojurl % { 'name': name }
+ projurl = c.repoprojurl % rep_dict
hunk ./darcsweb.cgi 2300
- reponame = name
+ reponame = dname
hunk ./darcsweb.cgi 2310
- config.__setattr__(name, tmp_config)
+ # index by display name to avoid clashes
+ config.__setattr__(dname, tmp_config)
}