[darcs-users] scheme bindings
Alex Shinn
foof at synthcode.com
Thu Sep 4 02:19:52 UTC 2003
>>>>> David Roundy <droundy at abridgegame.org> writes:
> I may just see about using this to make a cvs-darcs gateway. The
> primary difficulty I see is, do you support lumping together a
> bunch of changes into a single changeset (on the CVS side, that
> is)? It would be nice to be able to run an update just grabbing
> the changes that were made in a single commit, presumably by
> looking for changes with the same log message and a similar time.
Hmmm... the problem is CVS doesn't have such a concept of changesets, so
any solution would be fragile. For instance, my wiki uses a static
commit message, so any changes made in the same time frame would be
considered one changeset by the above approach. Do you have a
particular API in mind?
> For your darcs history you parse the patch dir, which is wrong.
> Darcs unrecord and unpull leave patches in the dir even after
> they're removed. You're better off parsing the inventory file.
I realized this, but for the first immediate use (the wiki) there is no
deletion of patches :) Although a proper history would report the
deletion actions as well. Will check out the darcs changes with
--machine-readable, thanks.
> I've taken a look, and don't have any suggestions or see any
> other problems. On the other hand, I'm not very
> scheme-proficient (and less object-oriented-scheme-proficient),
> so I also didn't understand much. I guess some documentation
> would be nice...
The OO is ugly but seemed the best way to choose between backends. I
wanted to solidify on the API, maybe by adding another backend (arch or
subversion), before adding documentation.
> If you are interested in C library bindings to darcs, I'd like to
> eventually create a libdarcs API, which would mean you wouldn't
> have to parse the output of darcs commands. I assume that Gauche
> Scheme can link with C bindings... although it's maybe more
> trouble than it's worth.
Yes, Gauche can link fairly easily with C, but in this case I've already
got the basic functionality working by parsing output so I don't think
I'd switch. In general I try not to use C except as a last resort :)
> I have one more question. I am interested in how you deal with
> the difference between a darcs record and a cvs commit. Your
> darcs vc-commit just runs a darcs record (which is precisely what
> I would have done), so the symmetry between update and commit is
> broken, since update runs pull, which pulls from a remote repo,
> while record is just local. Darcs splits a "cvs commit" into two
> commands, record and push, and I'm curious as to whether you have
> any ideas or plans to support the push command, and perhaps a
> more cvs-like usage of darcs?
Ah, good point. The intent is to focus on the most basic VC actions and
make them as similar as possible through all backends. Unfortunately,
some VC systems take very different approaches. In this case I think a
simple vc-commit is the right approach, but for darcs it should also do
a push as you say.
--
Alex
More information about the darcs-users
mailing list