[PATCH] Change behavior of changegroup hook for notify extension

Benoît Allard benoit at aeteurope.nl
Thu Dec 15 07:11:31 CST 2011


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.

Regards,
Benoît

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 4936 bytes
Desc: S/MIME Cryptographic Signature
URL: <http://selenic.com/pipermail/mercurial-devel/attachments/20111215/e91c3cc7/attachment.bin>


More information about the Mercurial-devel mailing list