[darcs-devel] [patch1745] use AnchoredPath instead of FileName for... (and 8 more)
Ben Franksen
bugs at darcs.net
Sun Nov 18 22:43:49 UTC 2018
Ben Franksen <ben.franksen at online.de> added the comment:
> As a result of this code, I'm seeing paths like .\foo/bar being printed
> by darcs on Windows whereas previously they were ./foo/bar. This breaks
> a few tests (issue2136, patch-index-spans, rename_shouldnt_affect_prefixes)
> as well as being quite ugly.
>
> Changing it to use the </> from System.FilePath.Posix fixes this, shall
> we just go with that?
Oh f***. This is a serious bug that doesn't only affect display of paths
but actually the on disk format of patches on Windows, since anchorPath
is now used for that, too. So this is a definite YES.
I am unsure how / why this changed from Posix to Native FilePath,
perhaps just a stupid mistake I made when cleaning up imports.
Note that e.g. realPath is meant to be used as input for IO actions that
take path arguments. This is a point that always confuses me: Is there a
general guide line for when we have to use the "native" path separator
(i.e. '\' on Windows) as opposed to the Posix one? I am pretty sure the
on-disk format of patches always uses the Posix separator, and similarly
the index, but that's about the end of my knowledge.
__________________________________
Darcs bug tracker <bugs at darcs.net>
<http://bugs.darcs.net/patch1745>
__________________________________
More information about the darcs-devel
mailing list