Mercurial > public > mercurial-scm > hg
comparison mercurial/ui.py @ 20574:5614f8cf0861
ui: suggest config --edit when no username is set
author | Matt Mackall <mpm@selenic.com> |
---|---|
date | Thu, 27 Feb 2014 14:46:29 -0600 |
parents | e5803150ea1d |
children | b75a23eec9c9 |
comparison
equal
deleted
inserted
replaced
20573:02d0d3aa42e3 | 20574:5614f8cf0861 |
---|---|
447 user = '%s@%s' % (util.getuser(), socket.getfqdn()) | 447 user = '%s@%s' % (util.getuser(), socket.getfqdn()) |
448 self.warn(_("no username found, using '%s' instead\n") % user) | 448 self.warn(_("no username found, using '%s' instead\n") % user) |
449 except KeyError: | 449 except KeyError: |
450 pass | 450 pass |
451 if not user: | 451 if not user: |
452 raise util.Abort(_('no username supplied (see "hg help config")')) | 452 raise util.Abort(_('no username supplied'), |
453 hint=_('use "hg config --edit" ' | |
454 ' to set your username')) | |
453 if "\n" in user: | 455 if "\n" in user: |
454 raise util.Abort(_("username %s contains a newline\n") % repr(user)) | 456 raise util.Abort(_("username %s contains a newline\n") % repr(user)) |
455 return user | 457 return user |
456 | 458 |
457 def shortuser(self, user): | 459 def shortuser(self, user): |