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

login
register
mail settings
Submitter Augie Fackler
Date June 13, 2017, 10:12 p.m.
Message ID <c98f63a3e8ee15645646.1497391959@augie-macbookpro2.roam.corp.google.com>
Download mbox | patch
Permalink /patch/21364/
State Accepted
Headers show

Comments

Augie Fackler - June 13, 2017, 10:12 p.m.
# 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.
Denis Laxalde - June 16, 2017, 12:27 p.m.
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)?
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=").
Augie Fackler - June 16, 2017, 2:52 p.m.
> 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.

Patch

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=
+  From [test]: test
+  this patch series consists of 1 patches.
+  
+  
+  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: devel
+  
+  # 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
+  +d
+  
+This change modifies file b
+  $ hg email --date '1970-1-1 0:2' --to=devel --test -r 1 --config patchbomb.publicurl=
+  From [test]: test
+  this patch series consists of 1 patches.
+  
+  
+  displaying [PATCH] b ...
+  Content-Type: text/plain; charset="us-ascii"
+  MIME-Version: 1.0
+  Content-Transfer-Encoding: 7bit
+  Subject: [PATCH] b
+  X-Mercurial-Node: 97d72e5f12c7e84f85064aa72e5a297142c36ed9
+  X-Mercurial-Series-Index: 1
+  X-Mercurial-Series-Total: 1
+  Message-Id: <97d72e5f12c7e84f8506.*@*> (glob)
+  X-Mercurial-Series-Id: <97d72e5f12c7e84f8506.*@*> (glob)
+  User-Agent: Mercurial-patchbomb/* (glob)
+  Date: Thu, 01 Jan 1970 00:02:00 +0000
+  From: test
+  To: devel
+  
+  # HG changeset patch
+  # User test
+  # Date 2 0
+  #      Thu Jan 01 00:00:02 1970 +0000
+  # Node ID 97d72e5f12c7e84f85064aa72e5a297142c36ed9
+  # Parent  8580ff50825a50c8f716709acdf8de0deddcd6ab
+  b
+  
+  diff -r 8580ff50825a -r 97d72e5f12c7 b
+  --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+  +++ b/b	Thu Jan 01 00:00:02 1970 +0000
+  @@ -0,0 +1,1 @@
+  +b
+  
+  $ hg email --date '1970-1-1 0:2' --to=devel --to=specific-person@example.com \
+  > --cc this-person-also@example.com --test -r '1+10' --config patchbomb.publicurl=
+  From [test]: test
+  this patch series consists of 2 patches.
+  
+  (optional) Subject: [PATCH 0 of 2] 
+  
+  displaying [PATCH 1 of 2] b ...
+  Content-Type: text/plain; charset="us-ascii"
+  MIME-Version: 1.0
+  Content-Transfer-Encoding: 7bit
+  Subject: [PATCH 1 of 2] b
+  X-Mercurial-Node: 97d72e5f12c7e84f85064aa72e5a297142c36ed9
+  X-Mercurial-Series-Index: 1
+  X-Mercurial-Series-Total: 2
+  Message-Id: <97d72e5f12c7e84f8506.*@*> (glob)
+  X-Mercurial-Series-Id: <97d72e5f12c7e84f8506.*@*> (glob)
+  User-Agent: Mercurial-patchbomb/* (glob)
+  Date: Thu, 01 Jan 1970 00:02:00 +0000
+  From: test
+  To: devel, specific-person@example.com
+  Cc: this-person-also@example.com
+  
+  # HG changeset patch
+  # User test
+  # Date 2 0
+  #      Thu Jan 01 00:00:02 1970 +0000
+  # Node ID 97d72e5f12c7e84f85064aa72e5a297142c36ed9
+  # Parent  8580ff50825a50c8f716709acdf8de0deddcd6ab
+  b
+  
+  diff -r 8580ff50825a -r 97d72e5f12c7 b
+  --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+  +++ b/b	Thu Jan 01 00:00:02 1970 +0000
+  @@ -0,0 +1,1 @@
+  +b
+  
+  displaying [PATCH 2 of 2] dd ...
+  Content-Type: text/plain; charset="us-ascii"
+  MIME-Version: 1.0
+  Content-Transfer-Encoding: 7bit
+  Subject: [PATCH 2 of 2] dd
+  X-Mercurial-Node: 3b6f1ec9dde933a40a115a7990f8b320477231af
+  X-Mercurial-Series-Index: 2
+  X-Mercurial-Series-Total: 2
+  Message-Id: <3b6f1ec9dde933a40a11.*@*> (glob)
+  X-Mercurial-Series-Id: <97d72e5f12c7e84f8506.*@*> (glob)
+  In-Reply-To: <97d72e5f12c7e84f8506.*@*> (glob)
+  References: <97d72e5f12c7e84f8506.*@*> (glob)
+  User-Agent: Mercurial-patchbomb/* (glob)
+  Date: Thu, 01 Jan 1970 00:02:01 +0000
+  From: test
+  To: devel, specific-person@example.com
+  Cc: this-person-also@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
+  +d
+