https://svn.lrde.epita.fr/svn/lrdetools/trunk
Index: ChangeLog
from Nicolas Pouillard <ertai(a)lrde.epita.fr>
Fix svn mail.
* vcs/lib/vcs/mail.rb: Fix and keep the backward compatiblity.
* vcs/lib/vcs/message.rb: Add the files argument.
mail.rb | 9 ++++++---
message.rb | 4 ++--
2 files changed, 8 insertions(+), 5 deletions(-)
Index: vcs/lib/vcs/mail.rb
--- vcs/lib/vcs/mail.rb (revision 244)
+++ vcs/lib/vcs/mail.rb (working copy)
@@ -18,12 +18,15 @@
# FIXME handle options properly.
# Delegata the option parsing to Sendmail.
def mail! ( files=[], options={} )
- raise unless files.empty?
+
+ # Backward compatiblity
+ files, options = [], files if files.is_a? Hash
+
error_handling :mail_failed
unless MAIL.exist?
options = DEFAULT_OPTIONS.merge(options)
- options[:signed => true] if Vcs.user_conf.sign
- print_body(MAIL, MAILER.parse_mail_options(options))
+ options[:signed] = Vcs.user_conf.sign
+ print_body(MAIL, MAILER.parse_mail_options(options), files)
end
MAILER.sendmail
MAIL.delete
Index: vcs/lib/vcs/message.rb
--- vcs/lib/vcs/message.rb (revision 244)
+++ vcs/lib/vcs/message.rb (working copy)
@@ -5,14 +5,14 @@
class Vcs
- def print_body ( file, options )
+ def print_body ( file, options, files=[] )
logger.info "Creating a new `#{file}' file"
file.open('w') do |f|
#FIXME add ---
f.puts options.to_yaml
f.puts '---'
f.puts
- with(f).message!
+ with(f).message!(files)
end
end
private :print_body