[darcs-devel] darcs patch: Implement polymorphic write support. (and 1 more)

David Roundy droundy at abridgegame.org
Wed Jul 13 05:47:47 PDT 2005


On Tue, Jul 12, 2005 at 05:10:40PM +0200, Juliusz Chroboczek wrote:
> David Roundy <droundy at abridgegame.org>:
> > stickPatchesInRepo :: Repository -> [Patch] -> IO ()
> 
> > stickPatchesInRepoAfterTest :: Repository -> [Patch] -> (IO ExitCode)
> >                             -> IO ExitCode
> 
> Sorry for the delay, I wanted to check Pull/Apply to see whether your
> interface would work there too.  It looks like it does.
> 
> I still need to do Push; if I'm convinced your scheme works even
> there, I'll try my hand at it (but let it not stop you from doing it
> if you feel like it).

No, I've finally gotten back to working on the conflicts stuff (paper and
pen work at the moment), so you go ahead.  You writing patches and me
reviewing them seems to be going pretty well for the moment.

And of course, as always feel free to come up with a less lame name than
stickPatchesInRepo...

> > We'd also need code to remove patches from the repository and replace them
> > with others (this is needed for unpull etc):
> >
> > replacePatchesInRepo :: Repository -> [Patch] -> [Patch] -> IO ()
> 
> Unpull is tricky.  On a Git repo, unpull can work only on the last
> recorded patch (all it does is to move the current HEAD, it doesn't
> touch the object store).  What's the right interface to make unpull do
> the right thing in this case, while preserving unpull's full generality
> in the case of native repos?

Hmmm.  Maybe we need a special case in unpull and unrecord?

Even if replacePatchesInRepo is only used for DarcsRepo, I think I'd prefer
to define it alongside stickPatchesInRepo, so that the
locking/atomicity-related code could be all in the same spot.  I think
that'd reduce the code complexity, and also reduce the danger of errors
related to getting everything updated in the right order.

This would also be relevant for amend-record, which has the same issues
(and the same constraints when working with git repositories).
-- 
David Roundy
http://www.darcs.net




More information about the darcs-devel mailing list