Issue 2595 darcs check crashes when there are broken patches/pristine

Title darcs check crashes when there are broken patches/pristine
Priority Status resolved
Milestone Resolved in 2.15.0
Superseder Nosy List bf
Assigned To

Created on 2018-07-03.09:28:07 by bf, last changed 2020-06-20.10:28:38 by bf.

msg20180 (view) Author: bf Date: 2018-07-03.09:28:05
This is the error message:

openBinaryFile: does not exist (No such file or directory)

The crash happens in Darcs.UI.Commands.Repair.brokenPristine where we
compare the new (repaired) pristine returned by replayRepositoryInTemp
with the recorded state. This pristine refers to files in the temporary
location /tmp/darcs-check which no longer exists.

To reproduce, run tests/repair.sh manually and look at the output. The
bug is not detected by the test script because we expect 'darcs check'
to fail at this point. I noticed it only because I was running the test
script manually to debug my latest refactorings.

It would be nice if we could distinguish between expected failure (such
as darcs check when there is a problem with the repository) and failure
that results from a crash, by returning a special return code for
unhandled exceptions (i.e. crashes) at the top level.
msg22053 (view) Author: bf Date: 2020-06-20.10:28:37
resolved by

patch 87d44f25f7c4c78c36832cdab55ecc2bd47c1bbf
Author: Ben Franksen <benjamin.franksen@helmholtz-berlin.de>
Date:   Wed Nov 21 18:45:41 CET 2018
  * fix in darcs check: withTempDir -> withDelayedDir
Date User Action Args
2018-07-03 09:28:07bfcreate
2020-06-20 10:28:38bfsetstatus: unknown -> resolved
messages: + msg22053
resolvedin: 2.15.0