diff -r 9e97a7a0bb82 -r e9f68860d5ed mercurial/hgweb/common.py --- a/mercurial/hgweb/common.py Tue Jan 01 11:19:15 2008 +0100 +++ b/mercurial/hgweb/common.py Tue Jan 01 17:07:15 2008 +0100 @@ -97,3 +97,12 @@ parity = 1 - parity count = 0 +def get_contact(config): + """Return repo contact information or empty string. + + web.contact is the primary source, but if that is not set, try + ui.username or $EMAIL as a fallback to display something useful. + """ + return (config("web", "contact") or + config("ui", "username") or + os.environ.get("EMAIL") or "")