Augie Fackler a écrit :


On Jun 16, 2017, at 08:27, Denis Laxalde <de...@laxalde.org> wrote:

Augie Fackler a écrit :
# HG changeset patch
# User Augie Fackler <au...@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-de...@example.com
+  > [devel.setsubscriptions]
+  > c or d = c-o...@example.com
+  > a or b = a-o...@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?

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-us...@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-de...@example.com]: mercurial-de...@example.com
+ Cc [c-o...@example.com mercurial-us...@example.com]: c-o...@example.com mercurial-us...@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-de...@example.com
+  Cc: c-o...@example.com, mercurial-us...@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
+
_______________________________________________
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel

Reply via email to