It occurred to me that this patch possibly doesn't work or could even do
harmful things in Windows, depending on how file paths are represented.
More specifically:
1. if absolute paths are in the form '/<volume>/<path>' (unlikely, I
think), this patch does evil things(tm), like considering '/D/file' to
be part of '/C/' repo.
2. if absolute paths are in the form '<volume>:\<path>' and the root of
a repo created in the top dir of a volume is '<volume>:\', i.e.:
'C:\file' and 'C:\' respectively, this patch fixes the problem on POSIX
but the issue still stands on Windows.
3. if absolute paths are in the form '<volume>:\<path>' and the root of
a repo created in the top dir of a volume is '<volume>:', i.e.:
'C:\file' and 'C:'(note the lack of slash) respectively, this patch
fixes the problem on POSIX. The issue was not present on Windows nor
this patch introduces a regression.
My guess is the right answer is the number 2, but I would be grateful if
someone could create a repo on the top dir of a volume and let me know
the content of the 'Root:' line in the output of `darcs show repo`.
Thanks,
Gian Piero.
PS: 'direction' (forward or backward) of the slashes is irrelevant as,
if I've read correctly the code, all backward slashes are transformed to
forward ones before comparing the paths.
|