Hi!
I confused myself and managed to confuse darcs too in the process.
Basically I moved a file (known by darcs) into a directory (not known by darcs) and darcs just dies with
darcs: /home/kolmodin/code/darcs-tests/darcs_mv3/dir1: openBinaryFile: inappropriate type (is a directory)
on most commands.
Here's how I did it:
# setup the environment
$ darcs -v
2.5.2 (release)
$ darcs init
$ touch file1
$ darcs add file1
$ darcs record file1
$ mkdir dir1
Now I'd like to move "file1" into "dir1", but accidentally forgot to use "darcs mv".
$ mv file1 dir1 # woops!
Correct the mistake by moving file1 with darcs.
$ darcs mv file1 dir1
Now darcs doesn't like me anymore:
$ darcs wh
darcs: /home/kolmodin/code/darcs-tests/darcs_mv_demo/dir1: openBinaryFile: inappropriate type (is a directory)
And I can't undo it:
$ darcs mv dir1 file1
darcs: /home/kolmodin/code/darcs-tests/darcs_mv_demo/dir1: openBinaryFile: inappropriate type (is a directory)
However, if I added "dir1" to the repo before I "darcs mv file1 dir1" it would give me a warning:
$ darcs add dir1
$ darcs mv file1 dir1/
darcs failed: A file or dir named dir1 (or perhaps differing only in case)
already exists in repository.
Use --case-ok to allow files differing only in case.
Just moving the "dir1" to something makes darcs not crash again:
$ mv dir1 dir2
$ darcs wh .
rmfile ./file1
What do you think? Maybe darcs should have added dir1 to the repo, and then moved file1 into the dir1
directory?
|