Excerpts from Jason Dagit's message of Tue Apr 22 18:20:25 +0200 2008: > On Tue, Apr 22, 2008 at 7:14 AM, Juliusz Chroboczek < > [EMAIL PROTECTED]> wrote: > > > > There is occasional discussion of creating a "libdarcs", where an API is > > > given and the programmer is able to use existing darcs functionality > > through > > > a library interface. > > > > Jason, I've already mentioned it before -- I think it's a horrible idea. > > > > Having a library means either having stable APIs, in which case you > > can no longer improve on code as easily, or library versioning, > > commonly known as ``DLL hell'' in the Windows world. > > > > The clean and flexible way is to have an easily scriptable Darcs. > > Darcs is fairly scriptable right now -- things like vc-darcs use Darcs > > as is, with no need to link against a libdarcs. > > > I've never looked at vc-darcs, but how does it handle the case of > selectively recording a hunk? I believe to satisfy the needs of the > original poster, hunk selection at record time via a gui would be necessary. > > One approach would be to use the current interactive interface of darcs. I > think this is inherently hard to do. Maybe I'm just bad at it, but I've > always found programmatically working with an interactive interface is > hard. Sometimes you mistakenly block waiting to hear from the other process > and vice versa. This leads to a flaky UI and none of us want that. I find > that error handling and reporting is usually harder when using the > subprocess technique. > > I was discussing libdarcs vs. subprocess with lelit in #darcs, and he > proposed that maybe the subprocess approach requires the following changes: > > darcs whatsnew --xml > This now gives you named or indexed hunks. > > darcs record --preselected-hunks=1,2,3 > This now takes the names or indexes from whatsnew.
That would be a great addition for a better programmable UI. However I would suggest rather more robust version: Imagine that between whatsnew and record, you've changed the sources, then your indexed hunks would probably be messed up. Moreover one want to name/index patches not just hunks. What I propose is to give them hashed names. Then if you have added a new patch, you will just skip it, and if you have changed some patches you will get an error and not a possibly bad behavior. Regards, -- Nicolas Pouillard aka Ertai
signature.asc
Description: PGP signature
_______________________________________________ darcs-users mailing list [email protected] http://lists.osuosl.org/mailman/listinfo/darcs-users
