mercurial/ui.py
changeset 4045 1bd6868b0b11
parent 4023 6ea8a3b805ee
parent 4044 78a0dd93db0b
child 4085 719488a98ebe
--- a/mercurial/ui.py	Wed Jan 24 23:06:45 2007 +0100
+++ b/mercurial/ui.py	Wed Jan 24 23:07:09 2007 +0100
@@ -344,12 +344,14 @@
             user = self.config("ui", "username")
         if user is None:
             user = os.environ.get("EMAIL")
-        if not user:
+        if user is None:
             try:
                 user = '%s@%s' % (util.getuser(), socket.getfqdn())
+                self.warn(_("No username found, using '%s' instead\n") % user)
             except KeyError:
-                raise util.Abort(_("Please specify a username."))
-            self.warn(_("No username found, using '%s' instead\n") % user)
+                pass
+        if not user:
+            raise util.Abort(_("Please specify a username."))
         return user
 
     def shortuser(self, user):