[darcs-devel] status of libdarcs?

Ben Coburn btcoburn at silicodon.net
Sat Mar 29 07:50:12 UTC 2008


I'm definitely in camp 2 and possibly camp 3 on the "libdarcs" needs/ 
goals.

So far I've written code to parse some of the interactive "human  
readable" output for a tool I'm writing. It was relatively painful and  
produced code that is somewhat more brittle than I had been hoping for.

I've also written some code to do things that are on the border  
between camps 2 and 3. For example, some of the code tags an almost  
arbitrary subset of patches in the repository. Think of piping the  
output of a darcs changes "select", into a darcs tag command.

I would like to see "libdarcs" provide object-oriented access to the  
darcs data store and finer-grain [i.e. partial] execution of darcs  
commands....

Example - Modify record data:
repo = Libdarcs.connect('foo');
patch = repo.recordToMem(...);
// modify patch data in special ways
repo.putFromMem(patch);

Example - Split repo:
repoOrig = Libdarcs.connect('foobar');
repoA = Libdarcs.connect('fixed/A');
repoB = Libdarcs.connect('fixed/B');
hashes = repoOrig.patchHashes();
foreach (h in hashes) {
	p = repoOrig.loadPatchHash(h);
	// Do smart stuff, then
	// repoA.putFromMem(p); or repoB.putFromMem(p);
	// maybe even clone p and put part of the patch in each repo.
}

Basically I think "libdarcs" should allow external code to be  
interposed between any gathering of information and subsequent  
manipulation of the repository (or export of data). While "one shot"  
commands that mimic the command line interface should be included,  
commands that allow for the manipulation of intermediate data are much  
more useful. There should also be a programmer friendly way to handle  
interactive commands where answers to each question may changes the  
other questions. Naturally "libdarcs" would also provide for reading/ 
parsing, creation, and output of all darcs data structures/formats  
(i.e. patch files, darcs send -o files, etc).

Hopefully I've been clear without being to verbose here.

P.S. Look forward to another darcs tool to be announced on darcs-users  
as soon as I get the alpha release tested a little bit more. :-)


Regards, Ben Coburn




More information about the darcs-devel mailing list