[darcs-users] [patch447] Generalize withSignalsBlocked and withGu... (and 2 more)

Gabriel Kerneis bugs at darcs.net
Thu Nov 4 14:40:55 UTC 2010


New submission from Gabriel Kerneis <kerneis at pps.jussieu.fr>:

Hi,

these 3 patches solve issue332 (ask to record if test fails).  Solving
this issue has required more work than expected because failing tests
used not to be signaled back to Record.lhs, throwing a generic
ExitFailure instead.

The first patch is used to allow accessing return values through
withSignalsBlocked and withGutsOf.  IMHO, it should be applied
regardless of what happens to the next two patches, but please review it
carefuly in case I got something wrong with the block/unblock couple.

The second patch gives more control on tests in finalizeRepositoryChanges.
Because of issue1988, Florent and I decided on IRC that the best
solution for now was to hide the changes behind an exception wrapper.
Therefore, this patch currently preserves backward-compatibility and
does not expose any new functionnality outside of Internal.hs.

The third patch effectively solves issue332.  Since issue1988 has not
been solved yet, I decided the cleanest way to go was to export the
modified finalizedRepositoryChanges' and use it in Record.lhs only.  The
long-term solution would be to expose the new version and use it
everywhere, but I do not feel confident enough to do that until
issue1988 is solved.  (I have done it for fun in my private repository,
but you really do not want to rely on something based on "grep" to
ensure no case has been forgotten).

I am not sure if the third patch should be included in darcs right now.
And I am not sure if we should keep the compatibility wrapper of the
second patch in the long-term (providing both interfaces) or completely
discard the old one.  But anyway, issue1988 should be fixed first.

This is my first substantial patch to darcs.  I would be glad to get any
feedback on style/effiency/etc.

Best,
              Gabriel

3 patches for repository http://darcs.net:

Thu Nov  4 12:45:45 CET 2010  Gabriel Kerneis <kerneis at pps.jussieu.fr>
  * Generalize withSignalsBlocked and withGutsOf

Thu Nov  4 13:49:38 CET 2010  Gabriel Kerneis <kerneis at pps.jussieu.fr>
  * Allow more control on tests run in finalizeRepositoryChanges
  
  Before this patch, tests run in finalizeRepositoryChanges either passed
  or killed darcs.  This blocked the resolution of issue332.
  
  This patch has two effects:
  - it adds a Bool parameter to finalizeRepositoryChanges to allow
    finalizing without running the tests (even if Test is present in the
    options of the repository),
  - it changes the return type of finalizeRepositoryChanges into IO(Either
    Int ()), where Int is the return code of the test in case it fails.
    The types of testAny, testRecorded and testTentative change
    accordingly.
  
  Note that currently, issue1988 prevents us from using IO(Either) safely.
  As a consequence, those changes are not yet exported. Backward-
  compatibility is preserved through the use of exceptionWrapper.  Once
  issue1988 is fixed, unwrapped finalizeRepositoryChanges' should replace
  finalizeRepositoryChanges.
  

Thu Nov  4 15:01:48 CET 2010  Gabriel Kerneis <kerneis at pps.jussieu.fr>
  * resolve issue332: ask to record if tests fail
  
  This patch is not as clean as possible, because of issue1988: it exports
  finalizeRepositoryChanges' whereas, in an ideal world, it should discard
  finalizeRepositoryChanges instead.  Since this cannot be done safely at
  the moment (ie. without the fear to miss some key compiler warnings), we
  shall live with this half-backed solution in the interim.

----------
files: generalize-withsignalsblocked-and-withgutsof.dpatch, unnamed
messages: 12904
nosy: kerneis
status: needs-screening
title: Generalize withSignalsBlocked and withGu... (and 2 more)

__________________________________
Darcs bug tracker <bugs at darcs.net>
<http://bugs.darcs.net/patch447>
__________________________________
-------------- next part --------------
A non-text attachment was scrubbed...
Name: generalize-withsignalsblocked-and-withgutsof.dpatch
Type: text/x-darcs-patch
Size: 73827 bytes
Desc: not available
URL: <http://lists.osuosl.org/pipermail/darcs-users/attachments/20101104/71cdc7f8/attachment-0001.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: unnamed
Type: application/octet-stream
Size: 5 bytes
Desc: not available
URL: <http://lists.osuosl.org/pipermail/darcs-users/attachments/20101104/71cdc7f8/attachment-0001.obj>


More information about the darcs-users mailing list