mercurial/hgweb/common.py
changeset 5779 e9f68860d5ed
parent 5760 0145f9afb0e7
child 5930 c301f15c965a
--- 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 "")