[darcs-devel] [patch2003] use unwind in rebase suspend

Ganesh Sittampalam bugs at darcs.net
Mon Feb 24 18:48:55 UTC 2020


Ganesh Sittampalam <ganesh at earth.li> added the comment:

On 24/02/2020 13:09, Ben Franksen wrote:

>> My current plan is just to inject the stuck fixups into the ToEdit
>> patch. The alternative of breaking the patch into pieces feels quite messy.
> 
> Fine. I was merely suggesting that a clean failure (i.e. just abort the
> whole operation) would be a viable option, too, one that doesn't require
> any special handling of this particular V1 bug.

I've actually failed to write a shell test for this situation so far. I
tried to transcribe the example I found in D.T.P.E.Unwind, but on the
command-line it ends up failing first with an error from newUr or
reconcileUnwindings. So it seems quite likely that no-one will run into
it in practice. And if they do they could amend the conflict to turn it
into its effect, and then suspend.

So just aborting seems like a good option after all.

For the record, the cleanest idea I had for implementing error recovery
was to introduce a type class like PrimUnwindRecovery, with a method
something like

stuckPatch
  :: PrimUnwindRecovery prim => String -> prim wA wB -> prim wA wB

The default implementation would just be to call error with the first
argument. For rebase suspend we would arrange for prim to be some
wrapped type that would embed both the error message as a warning and
the actual prim in the result. It could then be post-processed to
generate the warning. But anyway, let's just do without it for now.

I'll screen this one as well soon unless there are objections.

__________________________________
Darcs bug tracker <bugs at darcs.net>
<http://bugs.darcs.net/patch2003>
__________________________________


More information about the darcs-devel mailing list