##// END OF EJS Templates
Commit username: Better error message, abort on empty name, fix documentation.
Thomas Arendsen Hein -
r3489:c3345b0f default
parent child Browse files
Show More
@@ -401,8 +401,8 b' ui::'
401 username;;
401 username;;
402 The committer of a changeset created when running "commit".
402 The committer of a changeset created when running "commit".
403 Typically a person's name and email address, e.g. "Fred Widget
403 Typically a person's name and email address, e.g. "Fred Widget
404 <fred@example.com>". Default is $EMAIL. If no default is found,
404 <fred@example.com>". Default is $EMAIL. If no default is found, or the
405 the username have to be specified manually.
405 configured username is empty, it has to be specified manually.
406 verbose;;
406 verbose;;
407 Increase the amount of output printed. True or False. Default is False.
407 Increase the amount of output printed. True or False. Default is False.
408
408
@@ -235,8 +235,13 b' class ui(object):'
235 user = self.config("ui", "username")
235 user = self.config("ui", "username")
236 if user is None:
236 if user is None:
237 user = os.environ.get("EMAIL")
237 user = os.environ.get("EMAIL")
238 if user is None:
238 if not user:
239 raise util.Abort(_("No default username available, use -u"))
239 self.status(_("Please choose a commit username to be recorded "
240 "in the changelog via\ncommand line option "
241 '(-u "First Last <email@example.com>"), in the\n'
242 "configuration files (hgrc), or by setting the "
243 "EMAIL environment variable.\n\n"))
244 raise util.Abort(_("No commit username specified!"))
240 return user
245 return user
241
246
242 def shortuser(self, user):
247 def shortuser(self, user):
@@ -4,7 +4,11 b' user: My Name <myname@example.com'
4 date: Mon Jan 12 13:46:40 1970 +0000
4 date: Mon Jan 12 13:46:40 1970 +0000
5 summary: commit-1
5 summary: commit-1
6
6
7 abort: No default username available, use -u
7 Please choose a commit username to be recorded in the changelog via
8 command line option (-u "First Last <email@example.com>"), in the
9 configuration files (hgrc), or by setting the EMAIL environment variable.
10
11 abort: No commit username specified!
8 transaction abort!
12 transaction abort!
9 rollback completed
13 rollback completed
10 changeset: 1:2becd0bae6e6
14 changeset: 1:2becd0bae6e6
General Comments 0
You need to be logged in to leave comments. Login now