Patchwork patchbomb: add test that shows --to and --cc override matching config item

login
register
mail settings
Submitter Augie Fackler
Date Sept. 21, 2017, 2:34 p.m.
Message ID <bc0dde47a06db5349262.1506004443@augie-macbookpro2.roam.corp.google.com>
Download mbox | patch
Permalink /patch/24083/
State Superseded
Headers show

Comments

Augie Fackler - Sept. 21, 2017, 2:34 p.m.
# HG changeset patch
# User Augie Fackler <augie@google.com>
# Date 1497453237 14400
#      Wed Jun 14 11:13:57 2017 -0400
# Node ID bc0dde47a06db5349262b39a7ef20d66fda49fb7
# Parent  7cdc8c5a481a4321f2646317dee5454b257c3163
patchbomb: add test that shows --to and --cc override matching config item

As far as I know this has always been true and is intentional (it's in
line with many other behaviors), but it wasn't tested.
Augie Fackler - Sept. 21, 2017, 6:07 p.m.
Ignore this in favor of v2, this one has some missing globs. Sorry.

> On Sep 21, 2017, at 10:34, Augie Fackler <raf@durin42.com> wrote:
> 
> # HG changeset patch
> # User Augie Fackler <augie@google.com>
> # Date 1497453237 14400
> #      Wed Jun 14 11:13:57 2017 -0400
> # Node ID bc0dde47a06db5349262b39a7ef20d66fda49fb7
> # Parent  7cdc8c5a481a4321f2646317dee5454b257c3163
> patchbomb: add test that shows --to and --cc override matching config item
> 
> As far as I know this has always been true and is intentional (it's in
> line with many other behaviors), but it wasn't tested.
> 
> diff --git a/tests/test-patchbomb.t b/tests/test-patchbomb.t
> --- a/tests/test-patchbomb.t
> +++ b/tests/test-patchbomb.t
> @@ -70,6 +70,45 @@ Mercurial-patchbomb/.* -> Mercurial-patc
>   +a
> 
> 
> +If --to is specified on the command line, it should override any
> +email.to config setting. Same for --cc:
> +
> +  $ hg email --date '1970-1-1 0:1' -n -f quux --to foo --cc bar -r tip \
> +  >   --config email.to=bob@example.com --config email.cc=alice@example.com
> +  this patch series consists of 1 patches.
> +  
> +  
> +  displaying [PATCH] a ...
> +  Content-Type: text/plain; charset="us-ascii"
> +  MIME-Version: 1.0
> +  Content-Transfer-Encoding: 7bit
> +  Subject: [PATCH] a
> +  X-Mercurial-Node: 8580ff50825a50c8f716709acdf8de0deddcd6ab
> +  X-Mercurial-Series-Index: 1
> +  X-Mercurial-Series-Total: 1
> +  Message-Id: <8580ff50825a50c8f716.60@augie-macbookpro2.roam.corp.google.com>
> +  X-Mercurial-Series-Id: <8580ff50825a50c8f716.60@augie-macbookpro2.roam.corp.google.com>
> +  User-Agent: Mercurial-patchbomb/4.2.1+627-72f2cafb81e3
> +  Date: Thu, 01 Jan 1970 00:01:00 +0000
> +  From: quux
> +  To: foo
> +  Cc: bar
> +  
> +  # HG changeset patch
> +  # User test
> +  # Date 1 0
> +  #      Thu Jan 01 00:00:01 1970 +0000
> +  # Node ID 8580ff50825a50c8f716709acdf8de0deddcd6ab
> +  # Parent  0000000000000000000000000000000000000000
> +  a
> +  
> +  diff -r 000000000000 -r 8580ff50825a a
> +  --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
> +  +++ b/a	Thu Jan 01 00:00:01 1970 +0000
> +  @@ -0,0 +1,1 @@
> +  +a
> +  
> +
>   $ hg --config ui.interactive=1 email --confirm -n -f quux -t foo -c bar -r tip<<EOF
>> n
>> EOF
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel@mercurial-scm.org
> https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel

Patch

diff --git a/tests/test-patchbomb.t b/tests/test-patchbomb.t
--- a/tests/test-patchbomb.t
+++ b/tests/test-patchbomb.t
@@ -70,6 +70,45 @@  Mercurial-patchbomb/.* -> Mercurial-patc
   +a
   
 
+If --to is specified on the command line, it should override any
+email.to config setting. Same for --cc:
+
+  $ hg email --date '1970-1-1 0:1' -n -f quux --to foo --cc bar -r tip \
+  >   --config email.to=bob@example.com --config email.cc=alice@example.com
+  this patch series consists of 1 patches.
+  
+  
+  displaying [PATCH] a ...
+  Content-Type: text/plain; charset="us-ascii"
+  MIME-Version: 1.0
+  Content-Transfer-Encoding: 7bit
+  Subject: [PATCH] a
+  X-Mercurial-Node: 8580ff50825a50c8f716709acdf8de0deddcd6ab
+  X-Mercurial-Series-Index: 1
+  X-Mercurial-Series-Total: 1
+  Message-Id: <8580ff50825a50c8f716.60@augie-macbookpro2.roam.corp.google.com>
+  X-Mercurial-Series-Id: <8580ff50825a50c8f716.60@augie-macbookpro2.roam.corp.google.com>
+  User-Agent: Mercurial-patchbomb/4.2.1+627-72f2cafb81e3
+  Date: Thu, 01 Jan 1970 00:01:00 +0000
+  From: quux
+  To: foo
+  Cc: bar
+  
+  # HG changeset patch
+  # User test
+  # Date 1 0
+  #      Thu Jan 01 00:00:01 1970 +0000
+  # Node ID 8580ff50825a50c8f716709acdf8de0deddcd6ab
+  # Parent  0000000000000000000000000000000000000000
+  a
+  
+  diff -r 000000000000 -r 8580ff50825a a
+  --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+  +++ b/a	Thu Jan 01 00:00:01 1970 +0000
+  @@ -0,0 +1,1 @@
+  +a
+  
+
   $ hg --config ui.interactive=1 email --confirm -n -f quux -t foo -c bar -r tip<<EOF
   > n
   > EOF