[darcs-devel] [patch2153] resolve issue2672 and related

Ben Franksen ben.franksen at online.de
Mon Apr 5 07:45:36 UTC 2021


>>   * make sure repoLocation is an absolute or remote path
>>   
>>   The mkRepo constructor now takes an AbsoluteOrRemotePath instead of a
>>   String.
> 
> OK (why not change the Repo datatype instead of just relying on the
> internals not being exported?)

Many reasons. One is that I am not sure the classification done by the
constructor of AbsoluteOrRemotePath, which is ioAbsoluteOrRemote, is
actually correct. The only accessor of that classification is
Darcs.Util.Path.isRemote and that function is not used anywhere.
Instead, whenever we need to distinguish between local or ssh or http
path, we turn the AbsoluteOrRemotePath back into a plain String by
calling toPath and then re-parse the result. Thus storing an
AbsoluteOrRemotePath in a data structure is currently pointless.

It would be a different matter if AbsoluteOrRemotePath would store
remote paths in fully classified and parsed form, along with proper test
coverage.



More information about the darcs-devel mailing list