comparison mercurial/hgweb/hgwebdir_mod.py @ 5779:e9f68860d5ed

Don't let ui.username override web.contact (issue900) 4603eef60237 introduced using ui.username before web.contact, but this was never documented and might cause commit accidents. - Drop web.author (deprecated since 2005) - Try ui.username or $EMAIL as a fallback to display something useful. - Update docs for the fallbacks.
author Thomas Arendsen Hein <thomas@intevation.de>
date Tue, 01 Jan 2008 17:07:15 +0100
parents 0145f9afb0e7
children d0576d065993
comparison
equal deleted inserted replaced
5778:9e97a7a0bb82 5779:e9f68860d5ed
7 # of the GNU General Public License, incorporated herein by reference. 7 # of the GNU General Public License, incorporated herein by reference.
8 8
9 import os, mimetools, cStringIO 9 import os, mimetools, cStringIO
10 from mercurial.i18n import gettext as _ 10 from mercurial.i18n import gettext as _
11 from mercurial import ui, hg, util, templater 11 from mercurial import ui, hg, util, templater
12 from common import ErrorResponse, get_mtime, staticfile, style_map, paritygen 12 from common import ErrorResponse, get_mtime, staticfile, style_map, paritygen, \
13 get_contact
13 from hgweb_mod import hgweb 14 from hgweb_mod import hgweb
14 from request import wsgirequest 15 from request import wsgirequest
15 16
16 # This is a stopgap 17 # This is a stopgap
17 class hgwebdir(object): 18 class hgwebdir(object):
180 try: 181 try:
181 d = (get_mtime(path), util.makedate()[1]) 182 d = (get_mtime(path), util.makedate()[1])
182 except OSError: 183 except OSError:
183 continue 184 continue
184 185
185 contact = (get("ui", "username") or # preferred 186 contact = get_contact(get)
186 get("web", "contact") or # deprecated
187 get("web", "author", "")) # also
188 description = get("web", "description", "") 187 description = get("web", "description", "")
189 name = get("web", "name", name) 188 name = get("web", "name", name)
190 row = dict(contact=contact or "unknown", 189 row = dict(contact=contact or "unknown",
191 contact_sort=contact.upper() or "unknown", 190 contact_sort=contact.upper() or "unknown",
192 name=name, 191 name=name,