[darcs-devel] [issue255] User error?

Juliusz Chroboczek Juliusz.Chroboczek at pps.jussieu.fr
Fri Sep 1 08:13:35 PDT 2006


Hi Simon,

> 	darcs failed:  user error (Error applying patch to working dir:
> 	./darcs-all-0: renameFile: permission denied (Permission
> denied))

> This isn't very helpful!  At the very least it'd help to say *which*
> file is permission denied for.

> And "user error" sounds like my fault, but I don't know what I did
> wrong.

Yes, while we're careful with error handling, our error reporting is
quite horrible.  (It's improved a lot, by the way -- it used to
consist entirely of things like ``impossible case at...'', which
cannot be decoded without the source.)

I guess I'm going to have to spend some time with the hierarchichal
libraries in order to try to understand the Ghc condition system.  But
don't hold your breath -- understanding the Common Lisp condition
system took me a decade, and that one is documented.

> And much worse, while the message helpfully says what to do if you have
> no changes in your tree, it leaves you high and dry if you do!  Do I
> just have to abandon my work?

Well, it's only your working dir, after all.  It's in an undefined but
probably not too horribly broken state right now (a patch bundle has
been applied half-way to it), so you type ``darcs what | more'' and
work out which files you want to revert, and which ones you want to
keep.

The message does sound okay to me, but I'm useless at user interfaces,
and the English, she is difficult.  If anyone has a better suggestion
for the message, I'm listening.

> (The trouble with a revision-control system is that it's holding the
> crown jewels, so your users are more than usually sensitive about bugs!)

Your crown jewels are safe under _darcs/patches, and the above did not
do anything to them -- we're very, very careful about the committed
data.  (If you find any situation short of a system crash where we
actually corrupt your committed data, that's a /very/ serious bug.
And even a system crash we should survive in most cases, if your
filesystem can handle it -- I hear NTFS is journalled nowadays.)

For obvious efficiency reasons, we're not even trying to be atomic
when accessing the working dir.  In this case, for example, an action
failed half-way through the working dir -- some of the files are in
the old, and some in the new state.

We are reasonably careful with the working dir, though -- we will
always warn you before we allow you to do something destructive to the
working dir, and in one case (darcs revert) we'll even save enough
data to allow you to undo it (darcs unrevert).

                                        Juliusz




More information about the darcs-devel mailing list