[darcs-users] scheme bindings

David Roundy droundy at abridgegame.org
Wed Sep 3 11:54:18 UTC 2003


On Wed, Sep 03, 2003 at 02:46:05PM +0900, Alex Shinn wrote:
> I've written a generic version control library for Gauche Scheme, which
> currently supports CVS and Darcs backends:

Cool!  :)

> It's beta, but is currently being used with the Darcs backend to power
> the wiki on the site.  This could be handy for things like writing
> converters between two VC systems, or doing quick prototyping for
> scripts and GUI tools. 

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.

> Still open to API changes, so suggestions are welcome.

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.  If it begins with "Starting
with", then you also have to parse a file in the inventories directory.
Hmmm.  Probably better to just implement a darcs history command.
Actually, there is already the changes command, which gives what you want,
only only in a human-readable format that will be tough to parse.  I just
added an option --machine-readable to give the history in "show PatchInfo"
format (which is the format you're already parsing).

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...

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.  The
main reason I haven't created such a beast already is that I haven't had
need for it.  Let me know if you're interested.  It seems a little silly to
create a C API just to create a scheme API, but I'd like people to be able
to easily write programs that interface with darcs repos, and a C API seems
to be the way to do it, since pretty much every language can create
bindings to a C library.

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?
-- 
David Roundy
http://www.abridgegame.org




More information about the darcs-users mailing list