comparison mercurial/hgweb/hgweb_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 652f57de3ccf
children 323b9c55b328
comparison
equal deleted inserted replaced
5778:9e97a7a0bb82 5779:e9f68860d5ed
8 8
9 import os, mimetypes, re, mimetools, cStringIO 9 import os, mimetypes, re, mimetools, cStringIO
10 from mercurial.node import * 10 from mercurial.node import *
11 from mercurial import mdiff, ui, hg, util, archival, patch 11 from mercurial import mdiff, ui, hg, util, archival, patch
12 from mercurial import revlog, templater 12 from mercurial import revlog, templater
13 from common import ErrorResponse, get_mtime, style_map, paritygen 13 from common import ErrorResponse, get_mtime, style_map, paritygen, get_contact
14 from request import wsgirequest 14 from request import wsgirequest
15 import webcommands, protocol 15 import webcommands, protocol
16 16
17 shortcuts = { 17 shortcuts = {
18 'cl': [('cmd', ['changelog']), ('rev', None)], 18 'cl': [('cmd', ['changelog']), ('rev', None)],
806 start = max(0, count - self.maxchanges) 806 start = max(0, count - self.maxchanges)
807 end = min(count, start + self.maxchanges) 807 end = min(count, start + self.maxchanges)
808 808
809 yield tmpl("summary", 809 yield tmpl("summary",
810 desc=self.config("web", "description", "unknown"), 810 desc=self.config("web", "description", "unknown"),
811 owner=(self.config("ui", "username") or # preferred 811 owner=get_contact(self.config) or "unknown",
812 self.config("web", "contact") or # deprecated
813 self.config("web", "author", "unknown")), # also
814 lastchange=cl.read(cl.tip())[2], 812 lastchange=cl.read(cl.tip())[2],
815 tags=tagentries, 813 tags=tagentries,
816 branches=branches, 814 branches=branches,
817 shortlog=changelist, 815 shortlog=changelist,
818 node=hex(cl.tip()), 816 node=hex(cl.tip()),