[PATCH 3 of 3] patchbomb: make --git-format-patch imply --plain

Yuya Nishihara yuya at tcha.org
Sun Nov 20 05:38:43 EST 2016


On Thu, 17 Nov 2016 21:47:58 +0100, Henning Schild wrote:
> # HG changeset patch
> # User Henning Schild <henning at hennsch.de>
> # Date 1479415557 -3600
> #      Thu Nov 17 21:45:57 2016 +0100
> # Node ID de2b03a509491020f728f1955e39e2bfb9a77426
> # Parent  a9be53e26cb1ac19d1c0156062e8ae23f8366d8b
> patchbomb: make --git-format-patch imply --plain
> 
> Not using --plain would generate mails with the hg header in the git commit
> message. Since --git-format-patch already caters for git, might as well make
> sure users do not forget --plain.
> 
> diff --git a/hgext/patchbomb.py b/hgext/patchbomb.py
> --- a/hgext/patchbomb.py
> +++ b/hgext/patchbomb.py
> @@ -418,7 +418,7 @@
>  @command('email',
>      [('g', 'git', None, _('use git extended diff format')),
>      ('', 'git-format-patch', None, _('use git-format-patch email format '
> -       '(implies --git)')),
> +       '(implies --git and --plain)')),
>      ('', 'plain', None, _('omit hg patch header')),
>      ('o', 'outgoing', None,
>       _('send changes not found in the target repository')),
> @@ -527,6 +527,7 @@
>  
>      if (opts.get('git_format_patch')):
>          opts['git'] = True
> +        opts['plain'] = True
>  
>      if not (opts.get('test') or mbox):
>          # really sending
> diff --git a/tests/test-patchbomb.t b/tests/test-patchbomb.t
> --- a/tests/test-patchbomb.t
> +++ b/tests/test-patchbomb.t
> @@ -755,13 +755,6 @@
>    To: foo
>    Cc: bar
>    
> -  # HG changeset patch
> -  # User test
> -  # Date 3 0
> -  #      Thu Jan 01 00:00:03 1970 +0000
> -  # Node ID ff2c9fa2018b15fa74b33363bda9527323e2a99f
> -  # Parent  97d72e5f12c7e84f85064aa72e5a297142c36ed9
> -  c

But after reading this, I feel templating will be much nicer.


More information about the Mercurial-devel mailing list