digraph G {

    Pristine[shape=box, label="Pristine (libpijul::pristine)"];
    WorkingCopy[label="Working copy (libpijul::working_copy)", shape=box];
    Tree[shape=box, label="Tree (libpijul::pristine)"];
    Patch[shape=box, label="Patch (libpijul::patch)"];

    Add[label="Add/Rm/Mv (libpijul::fs)"];
    Add -> Tree;

    Output[label="Output (libpijul::output)"];
    Pristine -> Output;
    Output -> WorkingCopy;
    Output -> Tree;

    Record[label="Record (libpijul::record, libpijul::diff)"];

    Tree -> Record;
    WorkingCopy -> Record;
    Record -> Patch;
    Patch -> Apply;

    Apply[label="Apply (libpijul::apply)"];
    Apply -> Pristine;

    Apply -> Tree [style="dotted"];

    Patch -> Unrecord;
    Unrecord[label="Unrecord (libpijul::unrecord)"];
    Unrecord -> Tree [style="dotted"];
    Unrecord -> Pristine;
}