On Tue, Dec 09, 2008 at 09:22:34AM +0100, Petr Rockai wrote:
> Hi,
> 
> for most of the patch, I don't have an opinion (ie. I don't quite see what's
> going on there, the test flags are sort of opaque). However, I need to ask, 
> are
> you sure about those exitWith's replacing the return? I understand that will
> circumvent the cleanup replayRepository is doing... I'm not sure the `finally`
> is enough to pre-empt exitWith. Maybe it is and then it's all fine...

Yes, the key is to use the exception handling that comes in
Control.Exception, rather than the exception handling that comes in
System.IO.  The former catches things like asynchronous exceptions and
exitWith, while the latter doesn't.

> David Roundy <[EMAIL PROTECTED]> writes:
> > hunk ./src/Darcs/Commands/Check.lhs 96
> > -          unless (NoTest `elem` opts) $ testTentative repository
> > -          return ExitSuccess
> > +          unless (NoTest `elem` opts) $ testRecorded repository
> > +          exitWith ExitSuccess
> >          BrokenPristine newpris -> do
> >            brokenPristine newpris
> > hunk ./src/Darcs/Commands/Check.lhs 100
> > -          return $ ExitFailure 1
> > +          exitWith $ ExitFailure 1
> >          BrokenPatches newpris _ -> do
> >            brokenPristine newpris
> >            putInfo $ text "Found broken patches."
> > hunk ./src/Darcs/Commands/Check.lhs 104
> > -          return $ ExitFailure 1
> > -    exitWith res
> > +          exitWith $ ExitFailure 1
> >     where 
> >       brokenPristine newpris = do
> >           putInfo $ text "Looks like we have a difference..."
> 
> Above are the hunks that swap exitWith's for return's...
> 
> Yours,
>    Petr.
> 

-- 
David Roundy
http://www.darcs.net
_______________________________________________
darcs-users mailing list
[email protected]
http://lists.osuosl.org/mailman/listinfo/darcs-users

Reply via email to