On Mittwoch, 30. September 2009, Eric Kow wrote:
> Eric Kow <kowey@darcs.net> added the comment:
> I haven't tried to reproduce this, but this sounds like a simple
> consequence of the filepath being filtered out and darcs changes thinking
> it's doesn't have any arguments.
Unfortunately it is not. I managed to track it down to
Darcs.Patch.TouchesFiles.look_touch which actually gives back the wrong
result with the test.
look_touch :: Patchy p => [FilePath] -> p C(x y) -> (Bool, [FilePath])
When I instrument this function to print out its result and run darcs
changes d/notthere on a repo tat just contains d, (as in the test case) I
get:
ben@sarun[1]: .../darcs/darcs.net > ./dist/build/darcs/darcs changes
d/notthere --repodir=tests/R
Changes to d/notthere:
look_touch: (True,["./d/notthere"])
Sat Oct 3 14:31:38 CEST 2009 ben.franksen@online.de
* added directory d
I understand that look_touch is used in many places in darcs and even if I
managed to understand how it works (which I don't, see below) and 'fix' it,
this would probably break other darcs commands.
Darcs.Patch.TouchesFiles.look_touch lacks any documentation. Looking at its
code, I see that it gets the list of files by applying another undocumented
function Darcs.Patch.Apply.apply_to_filepaths which, int turn, calls the
undocumented method apply from class Apply. It looks as if apply doesn't
necessarily apply a patch, depending on which instance is selected, but
what it is /supposed/ to do if not apply the patch is beyond me to guess.
This is the point at which I gave up.
Cheers
Ben
|