[darcs-users] [patch136] remove the hardcoded string "_darcs" in ... (and 1 more) [status=amend-requested]
Petr Rockai
me at mornfall.net
Mon Jan 11 22:53:51 UTC 2010
Hi,
davidm <bugs at darcs.net> writes:
> Sun Jan 10 21:18:36 CET 2010 David Markvica <david at blueshellturtle.com>
> * remove the hardcoded string "_darcs" in some places and replace it with the global darcsdir
I think there is certain ambivalence about the usefulness of the
darcsdir global. But let's put that aside (I don't particularly care.)
> Sun Jan 10 22:29:32 CET 2010 David Markvica <david at blueshellturtle.com>
> * Resolve issue1726: Files with _darcs prefix are always boring
> hunk ./src/Darcs/Repository/Prefs.lhs 240
> isDarcsdir "" = True
> isDarcsdir ".." = True
> isDarcsdir "../" = True
> -isDarcsdir fp = darcsdir `isPrefixOf` fp
> +isDarcsdir fp = darcsdir == fp
I don't think this is correct. I'd say:
isDarcsdir "_darcs" = True
isDarcsdir fp = "_darcs/" `isPrefixOf` fp
Another option would be to use System.FilePath to break up fp and check
that (take 1 $ map dropTrailingPathSeparator $ splitPath fp) ==
["_darcs"] -- this is probably safest, although most elaborate.
Yours,
Petr.
More information about the darcs-users
mailing list