darcs

Issue 284 deal better with IO Error applying patch to working dir

Title deal better with IO Error applying patch to working dir
Priority wishlist Status resolved
Milestone Resolved in
Superseder Nosy List darcs-devel, dmitry.kurochkin, kowey, simonpj, thorkilnaur, tommy
Assigned To
Topics

Created on 2006-10-09.13:43:14 by simonpj, last changed 2009-08-27.13:50:17 by admin.

Messages
msg1055 (view) Author: simonpj Date: 2006-10-09.13:43:08
Dear Darcsers

Here's an error message I got in response to "darcs pull".  

[darcs failed:  user error (Error applying patch to working dir:
./darcs-all-0: renameFile: permission denied (Permission denied))
This may have left your working directory an inconsistent
but recoverable state. If you had no un-recorded changes
by using 'darcs revert' you should be able to make your
working directory consistent again.

Mention that the module sub-directory structure for .o and .hi files is
created automatically by GHC
simonpj@microsoft.com**20061006151234]

What should I do about this?  What file was permission denied on?
Without this information, I can't fix the problem.

(Incidentally, this was in the context of 
	darcs pull -av
and the error message was buried in the middle.  At the end there was no
summary of what went wrong, so when you are pulling 100 patches, it's
terribly easy to miss one of these "darcs failed" messages.)

Doing a second 'darcs pull' succeeds without error messages; but I
assume the problem, whatever it is, is still present.  So even if I fix
the problem by changing permissions, how would I then ge the right stuff
into my repository?

Sorry to be slow about this.   I know it is similar to a qn I have asked
before.

thanks for your help

Simon
msg1056 (view) Author: tommy Date: 2006-10-09.19:34:54
^^^^^^^^^^^^^
[...]
> What should I do about this?  What file was permission denied on?
> Without this information, I can't fix the problem.

The second line of darcs' error message comes from (show e)
where e is the io exception thrown by renameFile, so the file
./darcs-all-0 would be involved in some way, but I don't know if
it can't be moved or is in the way for the move.

It would not be difficult to intercepts this particular
exception and append detailed information on what Move darcs
tried to make, but a more general solution, that intercepts io
exceptions from any (io-)primitive apply is perhaps better, if
it can be done. Or maybe only a few cases would needs this extra
information, like Move that concerns two different file paths.

> Doing a second 'darcs pull' succeeds without error messages; but I
> assume the problem, whatever it is, is still present.  So even if I fix
> the problem by changing permissions, how would I then ge the right stuff
> into my repository?

When applying patches to working begins, the "repo" is already
successfully updated and all the right stuff is in place. The
problem is that only some of the new changes then makes it to
the working dir. Darcs of course remember nothing of this
failure in an earlier life, so the next invocation of darcs
thinks _you_ must have undone all the changes that actually
didn't made it to the working dir. And that is why you can "get
them back" with 'darcs revert'.

If a file wasn't renamed in working (but in pristine), darcs
should think you have deleted the "new" file and Whatsnew should
print a hunk with lots of minuses and a RmFile at the end.
msg1871 (view) Author: kowey Date: 2007-07-19.04:45:44
Fixed by tolerant application of patches (1.0.9).  On the other hand, it would
still be nice if darcs had this automatic backup feature from issue274.
History
Date User Action Args
2006-10-09 13:43:14simonpjcreate
2006-10-09 19:35:07tommysetstatus: unread -> unknown
nosy: droundy, tommy, kowey, simonpj
messages: + msg1056
2007-03-10 12:07:00koweysetnosy: + beschmi
superseder: + Automatically record a backup bundle of working dir changes before pull
title: Error applying patch -> deal better with IO Error applying patch to working dir
2007-07-19 04:45:49koweysetstatus: unknown -> resolved
nosy: droundy, tommy, beschmi, kowey, simonpj
superseder: - Automatically record a backup bundle of working dir changes before pull
messages: + msg1871
2009-08-06 17:43:09adminsetnosy: + markstos, jast, Serware, dmitry.kurochkin, darcs-devel, zooko, dagit, mornfall, simon, thorkilnaur, - droundy, simonpj
2009-08-06 20:40:14adminsetnosy: - beschmi
2009-08-10 21:56:18adminsetnosy: + simonpj, - markstos, darcs-devel, zooko, jast, dagit, Serware, mornfall
2009-08-25 17:56:26adminsetnosy: + darcs-devel, - simon
2009-08-27 13:50:17adminsetnosy: tommy, kowey, darcs-devel, simonpj, thorkilnaur, dmitry.kurochkin