[darcs-users] dir tree rearrangement problems

David Roundy droundy at abridgegame.org
Fri Dec 12 13:57:47 UTC 2003


On Fri, Dec 12, 2003 at 03:28:31PM +0200, Aggelos Economopoulos wrote:
> I'm using a 0.9.15-pre darcs, built before David's 'trailing newline'
> changes.  A couple of days ago, I branched to a new repo and made some
> changes in the directory structure.
> 
> Initially (irrelevant dirs omitted):
> proj/
> proj/_darcs/
> proj/src/
> 
> and the change was (pasting from the relevant darcs patch file, names 
> changed):
> 
> adddir ./src/new_dir
> adddir ./src/old_dir
> move ./src/a.c ./src/old_dir/a.c
> [30 more lines, moving the files in ./src/ to old_dir]
> addfile ./src/new_dir/whatever.h
> addfile ./src/new_dir/whatever.c
> addfile ./src/new_dir/main.aap
> [hunks for the 3 new files]
> 
> So, after some more hacking, I run 'darcs whatsnew -u | gview -' and got
> some really strange results (whatsnew thinking all the proj/src/ files
> (that I had moved in proj/old_dir/ in the previously recorded patch) have
> been removed).  I tried getting the repo and all the moves have indeed
> failed (proj/src/ old_dir is empty), although the patch is still in
> _darcs/patches and is the last patch mentioned in _darcs/inventory. I
> just built a new darcs binary from the current source, but get still
> won't give me the expected tree.

Hmmmm.  I played with doing something like this just now, and haven't been
able to get darcs to misbehave (which doesn't mean much).

> Did I do something horribly wrong before/when recording the patch?

As far as I can see, I don't see a user error here.  Recently when I
removed the "rm -rf" call when cleaning up from withTempDir, the haskell
replacement was faulty.  (I had assumed that if a directory exists and is
removeable it could be removed by removeDirectory, but if it's a symlink
that fails and you need to use removeFile--as far as I know this is the
only way to determing using the standard haskell libraries whether
something is a symlink...)  This had the result that some commands failed
when they didn't expect to.  This could have triggered your problem,
perhpas.

> Is this a known bug (ISTR some bugfixes that could be relevant but I
> can't be sure I've just been bitten by an old bug)?

Not a known bug, but hopefully an already fixed bug.  :)

> Is there a straightforward way to recover?

Well, I'm not sure what's wrong, so there are a couple of routes that may
work (and make a backup before trying any of them).  It is possible that
only _darcs/current is corrupted, in which case the new repair command
should work.  I think this is actually the most likely situation, as it
sounds like the actual patches in your repo are valid.

If repair doesn't work (and be sure to run darcs check afterwards to make
sure), you can do a darcs get --patch-name "slightly old patch" followed by
a series of pulls (pulling one patch at a time, preferably).  This would
allow you to isolate which patch was corrupt--any patches recorded after
there is corruption in _darcs/current could be corrupt.  If you get to this
point, I'd like to hear about (and see perhaps) the corrupt patch and
perhaps could figure out what went wrong (and how to fix it).
-- 
David Roundy
http://www.abridgegame.org




More information about the darcs-users mailing list