[darcs-users] darcs patch: Make FileName.drop_dotdot work with abso... (and 2 more)

David Roundy daveroundy at gmail.com
Fri Sep 26 14:17:23 UTC 2008


On Fri, Sep 26, 2008 at 5:58 AM, Eric Kow <kowey at darcs.net> wrote:
>> > Thu Sep 25 21:57:11 MSD 2008  Dmitry Kurochkin <dmitry.kurochkin at gmail.com>
>> >   * Make FileName.drop_dotdot work with absolute paths.
>>
>> Looks safe, although I'd prefer to move in the direction of not using
>> the FileName code in the RepoPath module, and to move back to only
>> using FileName for paths within a repository (which is what it was
>> written for).
>
> Thanks for clarifying that!
>
> I thought that was the case (in which case, by rights the FileName code
> should neither absolute paths nor "../foo/bar" (although "foo/../bar"
> should be ok).
>
> After 2.1.0, we really ought to tidy up our file path handling and make
> more of these assumptions explicit.  It might be good to move FileName
> into Darcs.Repository.FileName and also make sure that we are only using
> SubPath within a repository.  Slurpies should probably also only be
> using SubPath.

I already put a start into tidying up the file path handling, and
that's what has caused all this trouble.  I want to move towards using
AbsolutPath, etc throughout the code more, so that we can use the
compiler to enforce reasonable coding practice.

Yes, moving FileName into Darcs.Patch would be a good idea.  Also good
would be to remove the exports of fn2fp and fp2fn, which are the
biggest problems with the FileName module.  It might even be a good
idea to start by simply duplicating the FileName module, so that we
can modify it in the course of the refactor...

David


More information about the darcs-users mailing list