On Fri, Oct 17, 2014 at 2:59 AM, Ron W <ronw.m...@gmail.com> wrote:

> A question about libfossil: Is it possible to directly create a delta
> artifact? I ask this because it looks like SVN::Dump::Reader does not
> un-delta the artifact content. So either I would have to apply the delta
> myself (to provide the full text to libfossil) or convert the SVN delta
> into a Fossil delta.
>

If by "artifact" you mean "arbitrary blob," yes libf supports fossil's
delta generation, and they can be generated and applied independently of
the SCM content. See the f-delta tool for an example:

http://fossil.wanderinghorse.net/repos/libfossil/index.cgi/finfo?name=f-apps/f-delta.c

With the relative bits being:

http://fossil.wanderinghorse.net/repos/libfossil/index.cgi/info/c338817d2d1dbf7072921518c0a0a7f2aa8ea06d?ln=74-93


If by "artifact" you mean manifests/checkin records:

By default it prefers deltas, but (for historical compatibility) only
creates them once a delta has been seen in the given repo. It uses an algo,
derived directly from fossil, which, after building the delta, figures out
if is "too big to be worth the effort," and throws it away (creating a
baseline instead) if it is. libf offers a force flag to force the delta
generation, but doing so bypasses the "if too big..." check, and it's only
intended for testing purposes or to force the introduction of an initial
delta into the repo (after which libf and fossil will both prefer deltas
over baselines).

Caveat: libf currently only builds delta manifests in the context of a
checkin operation, so it sounds like it would need to be taught to create a
checkin's manifest without performing the checkin. That would require only
a small bit of refactoring. The core API supports building your own
manifests from scratch, but building deltas properly is tricky, best left
to the library, as opposed to generating one "by hand" (where "by hand"
really means "via an OO API").

The simplest way to create artifacts by hand is via the C++ API, as
demonstrated here:

http://fossil.wanderinghorse.net/repos/libfossil/index.cgi/info/80b312bea51eb012477b9887b6f7a55c0344a787?ln=171-178

which creates:

D 2014-10-17T07:29:25.000
T *myOtherTag *
T +myTag * its\svalue
T -sumdumtag *
U stephan
Z da69975a6374f993fd6e50cae1f61a10

-- 
----- stephan beal
http://wanderinghorse.net/home/stephan/
http://gplus.to/sgbeal
"Freedom is sloppy. But since tyranny's the only guaranteed byproduct of
those who insist on a perfect world, freedom will have to do." -- Bigby Wolf
_______________________________________________
fossil-users mailing list
fossil-users@lists.fossil-scm.org
http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users

Reply via email to