+1

On 12 November 2010 18:27, Paul Berry <p...@puppetlabs.com> wrote:
>
> Signed-off-by: Paul Berry <p...@puppetlabs.com>
> ---
> Local-branch: maint/next/add_local_branch_to_mail_patches
>  tasks/rake/mail_patches.rake |   13 ++++++++++++-
>  1 files changed, 12 insertions(+), 1 deletions(-)
>
> diff --git a/tasks/rake/mail_patches.rake b/tasks/rake/mail_patches.rake
> index 6375a22..be8dda1 100644
> --- a/tasks/rake/mail_patches.rake
> +++ b/tasks/rake/mail_patches.rake
> @@ -18,10 +18,21 @@ task :mail_patches do
>     # Create all of the patches
>     sh "git format-patch -C -M -s -n --subject-prefix='PATCH/facter' 
> #{parent}..HEAD"
>
> +    # Add info to the patches
> +    additional_info = "Local-branch: #{branch}\n"
> +    files = Dir.glob("00*.patch")
> +    files.each do |file|
> +        contents = File.read(file)
> +        contents.sub!(/^---\n/, "---\n#{additional_info}")
> +        File.open(file, 'w') do |file_handle|
> +            file_handle.print contents
> +        end
> +    end
> +
>     # And then mail them out.
>
>     # If we've got more than one patch, add --compose
> -    if Dir.glob("00*.patch").length > 1
> +    if files.length > 1
>         compose = "--compose"
>     else
>         compose = ""
> --
> 1.7.2
>
> --
> You received this message because you are subscribed to the Google Groups 
> "Puppet Developers" group.
> To post to this group, send email to puppet-...@googlegroups.com.
> To unsubscribe from this group, send email to 
> puppet-dev+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/puppet-dev?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Developers" group.
To post to this group, send email to puppet-...@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-dev+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-dev?hl=en.

Reply via email to