##// END OF EJS Templates
Abort on empty username so specifying a username can be forced....
Thomas Arendsen Hein -
r4044:78a0dd93 default
parent child Browse files
Show More
@@ -345,12 +345,14 b' class ui(object):'
345 345 user = self.config("ui", "username")
346 346 if user is None:
347 347 user = os.environ.get("EMAIL")
348 if not user:
348 if user is None:
349 349 try:
350 350 user = '%s@%s' % (util.getuser(), socket.getfqdn())
351 self.warn(_("No username found, using '%s' instead\n") % user)
351 352 except KeyError:
352 raise util.Abort(_("Please specify a username."))
353 self.warn(_("No username found, using '%s' instead\n") % user)
353 pass
354 if not user:
355 raise util.Abort(_("Please specify a username."))
354 356 return user
355 357
356 358 def shortuser(self, user):
@@ -24,5 +24,8 b' echo 1 > asdf'
24 24 hg commit -d '1000000 0' -u "foo@bar.com" -m commit-1
25 25 hg tip
26 26 echo 123 > asdf
27 echo "[ui]" > .hg/hgrc
28 echo "username = " >> .hg/hgrc
29 hg commit -d '1000000 0' -m commit-1
27 30 rm .hg/hgrc
28 31 hg commit -d '1000000 0' -m commit-1 2>&1 | sed -e "s/'[^']*'/user@host/"
@@ -22,4 +22,7 b' user: foo@bar.com'
22 22 date: Mon Jan 12 13:46:40 1970 +0000
23 23 summary: commit-1
24 24
25 abort: Please specify a username.
26 transaction abort!
27 rollback completed
25 28 No username found, using user@host instead
General Comments 0
You need to be logged in to leave comments. Login now