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.
--- 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]