changeset 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 02d0d3aa42e3
children e0e223b0a506
files mercurial/ui.py tests/test-install.t
diffstat 2 files changed, 4 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/ui.py	Thu Feb 27 14:01:52 2014 -0600
+++ b/mercurial/ui.py	Thu Feb 27 14:46:29 2014 -0600
@@ -449,7 +449,9 @@
             except KeyError:
                 pass
         if not user:
-            raise util.Abort(_('no username supplied (see "hg help config")'))
+            raise util.Abort(_('no username supplied'),
+                             hint=_('use "hg config --edit" '
+                                    ' to set your username'))
         if "\n" in user:
             raise util.Abort(_("username %s contains a newline\n") % repr(user))
         return user
--- a/tests/test-install.t	Thu Feb 27 14:01:52 2014 -0600
+++ b/tests/test-install.t	Thu Feb 27 14:46:29 2014 -0600
@@ -16,7 +16,7 @@
   checking templates (*mercurial?templates)... (glob)
   checking commit editor...
   checking username...
-   no username supplied (see "hg help config")
+   no username supplied
    (specify a username in your configuration file)
   1 problems detected, please check your install!
   [1]