Hint for setting the username

Augie Fackler raf at durin42.com
Tue Jul 9 13:21:48 CDT 2013


On Jul 9, 2013, at 10:51 AM, Arne Babenhauserheide <arne_bab at web.de> wrote:

> Hi,
> 
> As followup on the earlier discussion¹, I created a patch for adding a hint how to add the username. 
> 
> # HG changeset patch
> # User Arne Babenhauserheide <arne_bab at web.de>
> # Date 1373381124 -7200
> #      Tue Jul 09 16:45:24 2013 +0200
> # Node ID ffab6750bcc27f226ac8d3face81ff42baed5302
> # Parent  648d1974b3f328947ee6cf2d00c66815a33cd208
> when no username is set, provide a hint with the user rcfile.
> 
> diff -r 648d1974b3f3 -r ffab6750bcc2 mercurial/ui.py
> --- a/mercurial/ui.py   Sun Jun 30 15:19:39 2013 -0500
> +++ b/mercurial/ui.py   Tue Jul 09 16:45:24 2013 +0200
> @@ -448,7 +448,8 @@
>             except KeyError:
>                 pass
>         if not user:
> -            raise util.Abort(_('no username supplied (see "hg help config")'))
> +            raise util.Abort(_('no username supplied (see "hg help config")\n'
> +                               '(add section [ui] with username = YOURNAME in %s)')%scmutil.userrcpath()[0])

As Simon mentioned, this patch could use running the test suite and reading of the commit message guidelines.

Thanks!

>         if "\n" in user:
>             raise util.Abort(_("username %s contains a newline\n") % repr(user))
>         return user
> 
> 
> You can also pull it from bitbucket as ffab6750bcc27f226ac8d3face81ff42baed5302:
> 
>    https://bitbucket.org/ArneBab/hg-stable/
> 
> 
> Best wishes,
> Arne
> 
> ¹: discussion about the new-user workflow breaking when a username is
>   required:
>   http://draketo.de/light/english/dvcs-workflow-failures-git-hg
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel at selenic.com
> http://selenic.com/mailman/listinfo/mercurial-devel



More information about the Mercurial-devel mailing list