Could I ask for your review on this one, Petr? Thanks! Looks like it should be straightforward
On Sat, Nov 15, 2008 at 14:36:09 +0100, Christian Kellermann wrote:
> Hi,
>
> This adds the cc list to the success as well as the error message
> of darcs send. I have also included a simple test case that checks
> this.
>
> Kind regards,
>
> Christian
>
> Sat Nov 15 14:32:14 CET 2008 Christian Kellermann <[EMAIL PROTECTED]>
> * resolve issue1101: also display cc'ed recipients
>
resolve issue1101: also display cc'ed recipients
------------------------------------------------
> Christian Kellermann <[EMAIL PROTECTED]>**20081115133214
> Ignore-this: 9955a84598aa60e14f5471c02ec0d9b8
> ] hunk ./src/Darcs/Commands/Send.lhs 234
> sm_cmd <- get_sendmail_cmd opts
> (sendEmailDoc from (lt [t | SendMail t <- thetargets])
> (thesubject) (get_cc opts)
> sm_cmd contentAndBundle body >>
> - - putInfo ("Successfully sent patch bundle to: "++lt [ t |
> SendMail t <- thetargets ]++"."))
> + putInfo ("Successfully sent patch bundle to: "
> + ++ lt [ t | SendMail t <- thetargets ]
> + ++ ccs (get_cc opts) ++"."))
> `catch` \e -> let msg = "Email body left in " in
> do when (isJust mailfile) $
> putStrLn $ msg++(fromJust
> mailfile)++"."
> hunk ./src/Darcs/Commands/Send.lhs 241
> fail $ ioeGetErrorString e
> + ccs [] = []
> + ccs cs = " and cc'ed " ++ cs
> +
> when (null [ p | Post p <- thetargets]) sendmail
> nbody <- withOpenTemp $ \ (fh,fn) -> do
> generateEmail fh from (lt [t | SendMail t <- thetargets])
> thesubject (get_cc opts) body
> hunk ./src/Darcs/External.hs 425
> hClose hat
> let ftable = [ ('t',addressOnly t),('c',cc),('f',f),('s',s) ] ++
> ftable'
> r <- execSendmail ftable scmd fn
> - - when (r /= ExitSuccess) $ fail ("failed to send mail to: " ++ t
> + when (r /= ExitSuccess) $ fail ("failed to send mail to: "
> + ++ t ++ cc_list cc
> ++ "\nPerhaps sendmail is not
> configured.")
> else if have_mapi then do
> r <- withCString t $ \tp ->
> hunk ./src/Darcs/External.hs 447
> ('<':a2) -> takeWhile (/= '>') a2
> _ -> a
>
> + cc_list [] = []
> + cc_list c = " and cc'ed " ++ c
> +
> resendEmail :: String -> String -> B.ByteString -> IO ()
> resendEmail "" _ _ = return ()
> resendEmail t scmd body =
> addfile ./tests/issue1101.sh
> hunk ./tests/issue1101.sh 1
> +#!/usr/bin/env bash
> +set -ev
> +
> +DARCS_EDITOR=echo
> +export DARCS_EDITOR
> +export SENDMAIL=`which true`
> +
> +rm -rf temp1 temp2
> +mkdir temp1 temp2
> +
> +cd temp2
> +darcs init
> +
> +# setup test
> +cd ../temp1
> +darcs init
> +touch foo bar
> +darcs add foo bar
> +darcs record -a -m add_foo_bar -A x
> +
> +# Test that --cc is also printed as recipient in case of success
> +darcs send --author=me -a [EMAIL PROTECTED] [EMAIL PROTECTED] ../temp2
> 2>&1|grep -i [EMAIL PROTECTED]
> +
> +# Test that --cc is also printed as recipient in case of error
> +darcs send --author=me -a [EMAIL PROTECTED] [EMAIL PROTECTED] ../temp2
> 2>&1|grep -i [EMAIL PROTECTED]
> +
> +cd ..
> +rm -rf temp1 temp2
>
--
Eric Kow <http://www.nltg.brighton.ac.uk/home/Eric.Kow>
PGP Key ID: 08AC04F9
signature.asc
Description: Digital signature
_______________________________________________ darcs-users mailing list [email protected] http://lists.osuosl.org/mailman/listinfo/darcs-users
