[darcs-devel] darcs patch: remove dirty flag and IO method from Slurpy.

Ian Lynagh igloo at earth.li
Sun May 15 06:03:26 PDT 2005


On Sun, May 15, 2005 at 06:43:18AM -0400, David Roundy wrote:
> Hi Ian,
> 
> Here's a patch that removes the (Maybe (IO ())) field and dirty flag from
> Slurpies.

Thanks!

> We will need to figure out how to make setpref work with apply.
> Either we need to somehow write a special apply for the IO monad, or we
> need to add a setpref operation to WriteableDirectory.  Probably the
> latter, I imagine, since I don't know how to do the former.

Ah, I hadn't realised apply currently ignores ChangePref. That means
that currently we can create pristine from the patches and then create
working from pristine in the get command, with the prefs not being
created, doesn't it?

I'm not keen on the idea that apply might throw away ChangePref info if
it happens to be writing to a slurpy, though. It's the sort of thing
that might come back to bite us later when someone decides to write a
slurpy again for some reason.

This makes me wonder again about changing the datastructures to:

data NamedP = NamedP !PatchInfo ![PatchInfo] !Patch ![ChangePref]

data Patch = Move !FileName !FileName
           | DP !FileName !DirPatchType
           | FP !FileName !FilePatchType
           | Split [Patch]
           | ComP [Patch]
           | Merger !Bool !String Patch [Patch] Patch Patch
           | Conflictor Bool [Patch] [Patch]

data ChangePref = ChangePref !String !String !String

I don't think I like this, though. If ChangePrefs were more normal (WRT
conflicts) we could just have a _darcs/prefs in _darcs/current, but
it's not obvious how to do that either. Ho humm.


Thanks
Ian





More information about the darcs-devel mailing list