[darcs-users] Re: Branching, again, in more detail

Peter Simons simons at cryp.to
Thu Nov 20 16:06:29 UTC 2003


Okay, I think I have figured it out. Here is the inofficial

    Branching with Darcs Guide

:-)

It works like this: We are managing a free software package
and we want to make regular releases (tags), plus, we may
want to have variants of the repository (branches). Our
repository is named "myproject".

1. Tagging a version

This is supported by darcs directly; the 'tag' command
offers anything you need.

2. Branching

You want to re-write your build system, so you copy the
full repository to, say, "myproject-build-rewrite". In that
repository, you modify only build-system-related files and
record these changes. Pulling patches from the "myproject"
repository is equivalent to saying "cvs update", in a way.
When you're satisfied with the new build system, you 'pull'
the contents of "myproject-build-rewrite" to "myproject" to
import the branch back into the main trunk.

You don't need to keep the "myproject-build-rewrite"
repository around, because all information is contained in
the main repository. If you tag liberally and use good
comments, you should easily be able to re-create about any
version you'd want to.

3. A vendor branch

You want to track changes to an external library, which is
not version-controlled by darcs. So you set-up a repository
"mylibrary-vendor" and import the source code of the library
into it. Record that, and tag it "mylibrary-major.minor".
Then you can pull those files into whatever other project,
that depends on this library. (David, you said you had
another way of importing those? Like just 'get'ting a
repository into another repository?)

So a new vendor version comes along. The best way would be
to 'rsync' the new sources into the "mylibrary-vendor" with
deletion enabled, so that files that go away are tracked. Be
careful to ignore the _darcs directory in that case, though!
After that, 'whatsnew' should work fine; you can just
'record' the new version.

So you have patches a library and want to export those
changes to "mylibrary-vendor". Then you just 'pull' the
necessary patches into "mylibrary-vendor" and record them.
If you record carefully, your changes should not have many
dependencies, merging them shouldn't be a problem at all.
You can also submit those changes (quite easily) to the
library author.


That's about it. I guess, it would be nice to have darcs
offer the 'rsyncing' part, to make sure the parameters to
rsync are right. But other than that, all facilities are
there.

Peter





More information about the darcs-users mailing list