[darcs-users] scheme bindings

David Roundy droundy at abridgegame.org
Thu Sep 4 12:08:40 UTC 2003


On Thu, Sep 04, 2003 at 11:19:52AM +0900, Alex Shinn wrote:
> >>>>> 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?

Well, now that I know about it, I'm thinking that using cvsps would be a
reasonable way to get patchsets.  So I guess what I'm thinking now
is that perhaps you could use cvsps for your vc-history command, perhaps in
an alternate version of vc (say vc-cvsps), since you probably don't want to
require cvsps for everyone who wants to use vc-cvs.

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

Well, the way I've chosen to do deletions, darcs forgets about the patch
once it is deleted.  This simplifies some things, but means you have to be
careful about deletions.  For example, pull will never delete a patch, so
keeping two repos in sync when there are deletions could be a pain.  The
reason darcs forgets about deleted patches is so you can make mistakes and
correct them easily.  E.g. if you run a darcs record, and then remember you
forgot to add a file, you can just unrecord it add the file and then
rerecord it, without leaving a permanent record of your mistake.

Now that I think about it, there are also another situations in which
_darcs/patches/ can not reflect the contents of the repo.  If darcs is
interrrupted (via e.g. ctrl-C, power outage, kill -9) during a pull or
record, it may leave the repository in a consistent state, but with extra
patches sitting around.

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

Well, I actually think you probably shouldn't require a push to go with
each record.  Often (as is probably the case in your wiki) the local
repository may be the only one you care about, and then you'd like to avoid
running pushes.
-- 
David Roundy
http://www.abridgegame.org




More information about the darcs-users mailing list