# HG changeset patch # User Thomas Arendsen Hein # Date 1161608211 -7200 # Node ID c3345b0f2fcdb3bb8cf3a6bf572159ec7e190a90 # Parent 8f02223662c83bf0f5dc45a101ed982e78876697 Commit username: Better error message, abort on empty name, fix documentation. diff -r 8f02223662c8 -r c3345b0f2fcd doc/hgrc.5.txt --- a/doc/hgrc.5.txt Sun Oct 22 21:47:37 2006 -0300 +++ b/doc/hgrc.5.txt Mon Oct 23 14:56:51 2006 +0200 @@ -401,8 +401,8 @@ username;; The committer of a changeset created when running "commit". Typically a person's name and email address, e.g. "Fred Widget - ". Default is $EMAIL. If no default is found, - the username have to be specified manually. + ". Default is $EMAIL. If no default is found, or the + configured username is empty, it has to be specified manually. verbose;; Increase the amount of output printed. True or False. Default is False. diff -r 8f02223662c8 -r c3345b0f2fcd mercurial/ui.py --- a/mercurial/ui.py Sun Oct 22 21:47:37 2006 -0300 +++ b/mercurial/ui.py Mon Oct 23 14:56:51 2006 +0200 @@ -235,8 +235,13 @@ user = self.config("ui", "username") if user is None: user = os.environ.get("EMAIL") - if user is None: - raise util.Abort(_("No default username available, use -u")) + if not user: + self.status(_("Please choose a commit username to be recorded " + "in the changelog via\ncommand line option " + '(-u "First Last "), in the\n' + "configuration files (hgrc), or by setting the " + "EMAIL environment variable.\n\n")) + raise util.Abort(_("No commit username specified!")) return user def shortuser(self, user): diff -r 8f02223662c8 -r c3345b0f2fcd tests/test-committer.out --- a/tests/test-committer.out Sun Oct 22 21:47:37 2006 -0300 +++ b/tests/test-committer.out Mon Oct 23 14:56:51 2006 +0200 @@ -4,7 +4,11 @@ date: Mon Jan 12 13:46:40 1970 +0000 summary: commit-1 -abort: No default username available, use -u +Please choose a commit username to be recorded in the changelog via +command line option (-u "First Last "), in the +configuration files (hgrc), or by setting the EMAIL environment variable. + +abort: No commit username specified! transaction abort! rollback completed changeset: 1:2becd0bae6e6