[PATCH] Change behavior of changegroup hook for notify extension

Nikolaus.Schueler at lantiq.com Nikolaus.Schueler at lantiq.com
Thu Dec 15 07:43:04 CST 2011


> -----Original Message-----
> From: Benoît Allard [mailto:benoit at aeteurope.nl]
> Sent: Thursday, December 15, 2011 2:12 PM
> To: Schueler Nikolaus (LQKG IT RDS)
> Cc: mercurial-devel at selenic.com
> Subject: Re: [PATCH] Change behavior of changegroup hook for notify
> extension
> 
> On 12/15/2011 11:51 AM, Nikolaus.Schueler at lantiq.com wrote:
> >
> >
> >> -----Original Message-----
> >> From: Benoît Allard [mailto:benoit at aeteurope.nl]
> >> Sent: Monday, December 12, 2011 2:02 PM
> >> To: Schueler Nikolaus (LQKG IT RDS)
> >> Cc: mpm at selenic.com; mercurial-devel at selenic.com
> >> Subject: Re: [PATCH] Change behavior of changegroup hook for
> notify
> >> extension
> >>
> >> On 12/12/2011 1:51 PM, Nikolaus.Schueler at lantiq.com wrote:
> >>> diff --git a/hgext/notify.py b/hgext/notify.py
> >>> --- a/hgext/notify.py
> >>> +++ b/hgext/notify.py
> >>> @@ -108,6 +108,11 @@ notify.merge
> >>>    notify.mbox
> >>>      If set, append mails to this mbox file instead of sending.
> >> Default: None.
> >>>
> >>> +notify.fromauthor
> >>> +  If set, use the first committer of the changegroup for the
> >> "From" field of
> >>> +  the notification mail. If not set, use the system user of
> the
> >> pushing repo.
> >>> +  Default: False.
> >>> +
> >>
> >> I have to disagree with that one, the `email.from` configuration
> >> value
> >> will be used if none is set in the mail content (if this one is
> >> False)
> >>
> > But if the "email.from" value is not set, it uses the "system
> user", for example the HGUSER when run in a test. So the correct
> help text would be something like
> >
> > "... If not set, it uses the "email.from" value or the system
> user if that is not set."
> >
> > But maybe this is to complicated and I will omit the "If not
> set..." part completely ("system user" is not such a lucky choice
> here anyway, I have to admit).
> >
> >
> 
> We're getting somewhere, that's indeed better, but still not
> correct:
> 
> - If `email.from` is not set, `ui.username` will be used.
> - If `ui.username` is not set, it looks at the $HGUSER env
> variable.
> - If not set, then the system user running the hg process will be
> taken.
> 
> This is documented under the `email.from` and the `ui.username`
> setting.
> I would say, in your help message, you just need to refer to that
> `email.from` as it's your first fallback.
> 
> And that was the reason I adviced using `notify.from` as an option
> name,
> as its goal is to replace the `email.from` setting.
> 
Hello Benoit,

thanks for the suggestions. I already submitted the patch and now I'm waiting
if it gets basically accepted (Matt had some issues with me bloating the
tests to much). If it gets accepted, I will suggest to enhance 
the documentation according to  your suggestions.

Regards

Nik



More information about the Mercurial-devel mailing list