package irmin

  1. Overview
  2. Docs
Legend:
Library
Module
Module type
Parameter
Class
Class type

A repository contains a set of branches.

type t

The type of repository handles.

val create : Irmin.config -> t Lwt.t

create config connects to a repository in a backend-specific manner.

val branches : t -> branch_id list Lwt.t

The list of all persistent branch names. Similar to to git branch -a.

val remove_branch : t -> branch_id -> unit Lwt.t

remove_branch t name removes the branch name from the local store. Similar to git branch -D <name>

val heads : t -> commit_id list Lwt.t

heads t is the list of all the heads in local store. Similar to git rev-list --all.

val watch_branches : t -> ?init:(branch_id * commit_id) list -> (branch_id -> commit_id Irmin.diff -> unit Lwt.t) -> (unit -> unit Lwt.t) Lwt.t

watch_branches t f calls f every time a branch is added, removed or updated in the local store. Return a function to remove the handler.

val export : ?full:bool -> ?depth:int -> ?min:commit_id list -> ?max:commit_id list -> t -> slice Lwt.t

export t ~depth ~min ~max exports the store slice between min and max, using at most depth history depth (starting from the max).

If max is not specified, use the current heads. If min is not specified, use an unbound past (but can still be limited by depth).

depth is used to limit the depth of the commit history. None here means no limitation.

If 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.

val import : t -> slice -> [ `Ok | `Error ] Lwt.t

import t s imports the contents of the slice s in t. Does not modify branches.

val task_of_commit_id : t -> commit_id -> Irmin.task Lwt.t

task_of_commit_id t h is the task which created h. Useful to retrieve the commit date and the committer name.

OCaml

Innovation. Community. Security.