Patchwork [4,of,5,RFC] patchbomb: lay test groundwork for some new functionality

login
register
mail settings
Submitter Denis Laxalde
Date June 19, 2017, 8:06 a.m.
Message ID <d6d08991-0a21-21c3-f173-990621f36474@laxalde.org>
Download mbox | patch
Permalink /patch/21502/
State Changes Requested
Headers show

Comments

Denis Laxalde - June 19, 2017, 8:06 a.m.
Augie Fackler a écrit :
>
>> On Jun 16, 2017, at 08:27, Denis Laxalde <denis@laxalde.org> wrote:
>>
>> Augie Fackler a écrit :
>>> # HG changeset patch
>>> # User Augie Fackler <augie@google.com>
>>> # Date 1497385899 14400
>>> #      Tue Jun 13 16:31:39 2017 -0400
>>> # Node ID c98f63a3e8ee15645646539ba08b7b7682237cab
>>> # Parent  218470bf601bb0baaae333c73ccc0aab615d8f40
>>> patchbomb: lay test groundwork for some new functionality
>>>
>>> These email blobs are so big, it'll make things easier to review to
>>> add this, then implement the feature so the behavior variation is
>>> obvious.
>>>
>>> diff --git a/tests/test-patchbomb.t b/tests/test-patchbomb.t
>>> --- a/tests/test-patchbomb.t
>>> +++ b/tests/test-patchbomb.t
>>> @@ -3028,3 +3028,155 @@ multiple heads are missing at public
>>>   [255]
>>>
>>> #endif
>>> +
>>> +Test hg email defaults settings:
>>> +  $ cat >> .hgemaildefaults <<EOF
>>> +  > [devel]
>>> +  > to = mercurial-devel@example.com
>>> +  > [devel.setsubscriptions]
>>> +  > c or d = c-or-d@example.com
>>> +  > a or b = a-or-b@example.com
>>> +  > EOF
>>> +This change modifies file d
>>> +  $ hg email --date '1970-1-1 0:2' --to=devel --test -r 10 --config patchbomb.publicurl=
>>
>> I wonder if abusing the --to flag to select an alias (i.e. the "devel"
>> section in .hgemaildefaults, not sure how to name this) is really a good
>> idea. It gets confusing because, depending on the value of the --to
>> flag, the behavior is significantly different.
>> Maybe consider a dedicated flag (e.g. --alias=devel, suggesting "alias"
>> in the sense of email alias)?
>
> I disagree. If others agree with you, I'm happy to change it. Think of it as a virtual mailing list of sorts.
>
>> That would also allow the command to work without a "to=" option under
>> "[devel]" section in .hgemaildefaults (e.g. one might only want a "cc=").
>
> It already does.
>

Below is what I tried locally based on patch 5. The --to=users flag has 
no effect. Am I missing something?

+  +d
+
Augie Fackler - June 20, 2017, 2:49 a.m.
> On Jun 19, 2017, at 4:06 AM, Denis Laxalde <denis@laxalde.org> wrote:
> 
> Below is what I tried locally based on patch 5. The --to=users flag has no effect. Am I missing something?
> 
> diff --git a/tests/test-patchbomb.t b/tests/test-patchbomb.t
> --- a/tests/test-patchbomb.t
> +++ b/tests/test-patchbomb.t
> @@ -3191,3 +3191,45 @@ This change modifies file b
>    d
>   +d
> 
> +  $ cat >> .hgemaildefaults <<EOF
> +  > [users]
> +  > cc = mercurial-users@example.com
> +  > EOF
> +  $ hg email --date '1970-1-1 0:2' --to=devel --to=users --test -r 10 --config patchbomb.publicurl=
> +  From [test]: test
> +  this patch series consists of 1 patches.
> +
> +  To [mercurial-devel@example.com]: mercurial-devel@example.com
> +  Cc [c-or-d@example.com mercurial-users@example.com]: c-or-d@example.com mercurial-users@example.com
> +

It had the expected effect: it expanded the alias, which has a Cc: but no To:. That’s (in part) why I didn’t allow aliases to contain @, since it seems extremely unlikely that a mail address without an @ is a user’s intent in the wild (not zero users, but near enough).

Patch

diff --git a/tests/test-patchbomb.t b/tests/test-patchbomb.t
--- a/tests/test-patchbomb.t
+++ b/tests/test-patchbomb.t
@@ -3191,3 +3191,45 @@  This change modifies file b
     d
    +d

+  $ cat >> .hgemaildefaults <<EOF
+  > [users]
+  > cc = mercurial-users@example.com
+  > EOF
+  $ hg email --date '1970-1-1 0:2' --to=devel --to=users --test -r 10 
--config patchbomb.publicurl=
+  From [test]: test
+  this patch series consists of 1 patches.
+
+  To [mercurial-devel@example.com]: mercurial-devel@example.com
+  Cc [c-or-d@example.com mercurial-users@example.com]: 
c-or-d@example.com mercurial-users@example.com
+
+  displaying [PATCH] dd ...
+  Content-Type: text/plain; charset="us-ascii"
+  MIME-Version: 1.0
+  Content-Transfer-Encoding: 7bit
+  Subject: [PATCH] dd
+  X-Mercurial-Node: 3b6f1ec9dde933a40a115a7990f8b320477231af
+  X-Mercurial-Series-Index: 1
+  X-Mercurial-Series-Total: 1
+  Message-Id: <3b6f1ec9dde933a40a11.*@*> (glob)
+  X-Mercurial-Series-Id: <3b6f1ec9dde933a40a11.*@*> (glob)
+  User-Agent: Mercurial-patchbomb/* (glob)
+  Date: Thu, 01 Jan 1970 00:02:00 +0000
+  From: test
+  To: mercurial-devel@example.com
+  Cc: c-or-d@example.com, mercurial-users@example.com
+
+  # HG changeset patch
+  # User test
+  # Date 5 0
+  #      Thu Jan 01 00:00:05 1970 +0000
+  # Branch test
+  # Node ID 3b6f1ec9dde933a40a115a7990f8b320477231af
+  # Parent  2f9fa9b998c5fe3ac2bd9a2b14bfcbeecbc7c268
+  dd
+
+  diff -r 2f9fa9b998c5 -r 3b6f1ec9dde9 d
+  --- a/d      Thu Jan 01 00:00:04 1970 +0000
+  +++ b/d      Thu Jan 01 00:00:05 1970 +0000
+  @@ -1,1 +1,2 @@
+   d