changeset 55:2add70d51441

From: Thomas Arendsen Hein <thomas@intevation.de> Good. Attached is a patch which also tries to use $EMAIL as the commit user and removed a try/except by using os.environ.get.
author mpm@selenic.com
date Wed, 11 May 2005 14:38:26 -0800
parents b24731008221
children ad2ea1185f04
files mercurial/hg.py
diffstat 1 files changed, 3 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/hg.py	Wed May 11 14:37:23 2005 -0800
+++ b/mercurial/hg.py	Wed May 11 14:38:26 2005 -0800
@@ -124,8 +124,9 @@
         return self.extract(self.revision(node))
 
     def add(self, manifest, list, desc, transaction, p1=None, p2=None):
-        try: user = os.environ["HGUSER"]
-        except: user = os.environ["LOGNAME"] + '@' + socket.getfqdn()
+        user = (os.environ.get("HGUSER") or
+                os.environ.get("EMAIL") or
+                os.environ.get("LOGNAME", "unknown") + '@' + socket.getfqdn())
         date = "%d %d" % (time.time(), time.timezone)
         list.sort()
         l = [hex(manifest), user, date] + list + ["", desc]