I didn't think about what I was doing and did something like this:
darcs ob --last 1 -a -o "stash-2012/10/31.dpatch"
forgetting that -o creates a *file*.
darcs died with:
darcs: /tmp/repo/stash-2012/10/31.dpatch-0: takeFile
/tmp/repo/stash-2012/10/31.dpatch-0 in /tmp/repo: does not exist (No
such file or directory)
Clearly, the '/'s are invalid in a filename; we should attempt to catch
invalid file names in a more pleasant way.
This is a bit tricky.
Pull/Send/Obliterate(which is in Unrecord.hs) all create bundles. They
all parse the options attempting to find a "-o FILE", and then make a
bundle - we should create a single function to write out a given bundle
and get the output name from the options.
The actual failure occurs in Repository/Lock where wordReadableTemp
calls takeFile, which fails due to the stash-2012 "directory" not
existing. I suppose takeFile could/should check that its filepath
argument is valid (though I'm not sure how to do this without attempting
to create the file (which may already exist!)).
It might be nice to do a bit of sanity checking when parsing the
arguments, i.e. when reading a -o flag, check whether the path looks
sane in some central point...
More thinking/investigation required.