A repository contains a set of branches.
type t = repo
The type of repository handles.
close t frees up all the resources associated with
t. Any operations run on a closed handle will raise
val export : ?full:bool -> ?depth:int -> ?min:commit list -> ?max:[ `Head | `Max of commit list ] -> t -> slice Lwt.t
export t ~full ~depth ~min ~max exports the store slice between
max, using at most
depth history depth (starting from the max).
max is `Head (also the default value), use the current
min is not specified, use an unbound past (but can still be limited by
depth is used to limit the depth of the commit history.
None here means no limitation.
full is set (default is true), the full graph, including the commits, nodes and contents, is exported, otherwise it is the commit history graph only.
import t s imports the contents of the slice
t. Does not modify branches.
The type for elements iterated over by
val elt_t : elt Irmin.Type.t
val iter : ?cache_size:int -> min:elt list -> max:elt list -> ?edge:(elt -> elt -> unit Lwt.t) -> ?branch:(branch -> unit Lwt.t) -> ?commit:(hash -> unit Lwt.t) -> ?node:(hash -> unit Lwt.t) -> ?contents:(hash -> unit Lwt.t) -> ?skip_branch:(branch -> bool Lwt.t) -> ?skip_commit:(hash -> bool Lwt.t) -> ?skip_node:(hash -> bool Lwt.t) -> ?skip_contents:(hash -> bool Lwt.t) -> ?pred_branch:(t -> branch -> elt list Lwt.t) -> ?pred_commit:(t -> hash -> elt list Lwt.t) -> ?pred_node:(t -> hash -> elt list Lwt.t) -> ?pred_contents:(t -> hash -> elt list Lwt.t) -> ?rev:bool -> t -> unit Lwt.t
iter t iterates in topological order over the closure graph of
rev is set (by default it is) the traversal is done in reverse order.
skip_contents allow the traversal to be stopped when the corresponding objects are traversed. By default no objects are skipped.
contents functions are called whenever the corresponding objects are traversed. By default these functions do nothing. These functions are not called on skipped objects.
pred_contents implicitly define the graph underlying the traversal. By default they exactly match the underlying Merkle graph of the repository
t. These functions can be used to traverse a slightly modified version of that graph, for instance by modifying
pred_contents to implicitly link structured contents with other objects in the graph.
The traversed objects are all included between
min (included) and
max (included), following the Merkle graph order. Moreover, the
min boundary is extended as follows:
- contents and node objects in
minstop the traversal; their predecessors are not traversed.
- commit objects in
minstop the traversal for their commit predecessors, but their sub-node are still traversed. This allows users to define an inclusive range of commit to iterate over.
- branch objects in
minimplicitly add to
minthe commit they are pointing to; this allow users to define the iteration between two branches.
cache_size is the size of the LRU used to store traversed objects. If an entry is evicted from the LRU, it can be traversed multiple times by
None (the default), no entries is ever evicted from the cache; hence every object is only traversed once, at the cost of having to store all the traversed objects in memory.