Hi Florian,

Following up on this. Unfortunately, the review ends in a bit of an open
question, but maybe it's one you'd like to comment on?

> I still don't have a very good idea why this patch works exactly.

So I was puzzling over this some more and decided to poke at it with a
little printf debugging.

Here is the line I inserted in Darcs.Commands.Annotate

  +putStrLn (show file_or_directory)
   if toFilePath file_or_directory == ""

And here's the output when I do

 darcs annotate .                       | ""
 cd ..; darcs annotate  --repodir foo . | "."

So let's look at Darcs.Commands.Annotate a little closer

  if toFilePath file_or_directory == ""
    then case pop of (Pop _ pt) -> annotate_pop opts pinfo pt -- [#1]
    else case lookup_thing (toFilePath file_or_directory) pop of
      Nothing -> fail $ "There is no file or directory named '" -- [#3]
      Just (Pop _ pt@(PopDir i _))
          | modifiedHowI i == ...
          | otherwise -> annotate_pop opts pinfo pt -- [#2]

It looks like  "darcs annotate ." is handled by [#1]
and "cd ..; darcs annotate  --repodir foo ." by [#2] with patch
or blocked by [#3] without the patch.

So it looks like the reason Florian's patch has the intended effect is
that it allows this part of the code (#4) to trigger:

    | BC.unpack (nameI i) == takeWhile (/='/') d =
        case dropWhile (=='/') $ dropWhile (/='/') d of
        "" -> Just p -- [#4]
        d' -> ...

OK, so is this really the right solution?  Or do we want a solution
that's more on the level of fixSubPaths?

-- 
Eric Kow <http://www.nltg.brighton.ac.uk/home/Eric.Kow>
PGP Key ID: 08AC04F9

Attachment: pgpN7bIVrXVHu.pgp
Description: PGP signature

_______________________________________________
darcs-users mailing list
[email protected]
http://lists.osuosl.org/mailman/listinfo/darcs-users

Reply via email to