Mercurial > public > mercurial-scm > hg-stable
diff mercurial/ui.py @ 3721:98f2507c5551
only print a warning when no username is specified
- revert most of 8b55c0ba
- display the username during interactive commit
author | Benoit Boissinot <benoit.boissinot@ens-lyon.org> |
---|---|
date | Tue, 28 Nov 2006 21:16:05 +0100 |
parents | 7e622c9a9707 |
children | 9f5c46c50118 |
line wrap: on
line diff
--- a/mercurial/ui.py Tue Nov 28 19:11:46 2006 +0100 +++ b/mercurial/ui.py Tue Nov 28 21:16:05 2006 +0100 @@ -336,8 +336,8 @@ Searched in this order: $HGUSER, [ui] section of hgrcs, $EMAIL and stop searching if one of these is set. - Abort if no username is found, to force specifying the commit user - with line option or repo hgrc. + If not found, use ($LOGNAME or $USER or $LNAME or + $USERNAME) +"@full.hostname". """ user = os.environ.get("HGUSER") if user is None: @@ -345,12 +345,11 @@ if user is None: user = os.environ.get("EMAIL") if not user: - self.status(_("Please choose a commit username to be recorded " - "in the changelog via\ncommand line option " - '(-u "First Last <email@example.com>"), in the\n' - "configuration files (hgrc), or by setting the " - "EMAIL environment variable.\n\n")) - raise util.Abort(_("No commit username specified!")) + try: + user = '%s@%s' % (util.getuser(), socket.getfqdn()) + except KeyError: + raise util.Abort(_("Please specify a username.")) + self.warn(_("No username found, using '%s' instead\n" % user)) return user def shortuser(self, user):