Legend:
Library
Module
Module type
Parameter
Class
Class type
Library
Module
Module type
Parameter
Class
Class type
val name : t -> string
name t
is t
's name.
remove t
deletes branch t
. If t
does not exist, this does nothing.
rename t new_name
changes the name of this branch. It is an error if new_name
already exists.
head t
is the current head of the branch, or None
if it doesn't currently exist.
val wait_for_head :
t ->
?switch:Lwt_switch.t ->
(Commit.t option -> [ `Finish of 'a | `Again | `Abort ] or_error Lwt.t) ->
[ `Abort | `Finish of 'a ] or_error Lwt.t
wait_for_head t fn
calls fn commit
on the current commit. If it returns `Again
then it waits for the commit to change and tries again. If switch
is provided, then turning off the switch will make the wait return `Abort
at the next opportunity.
val wait_for_path :
t ->
?switch:Lwt_switch.t ->
Datakit_path.t ->
([ `File of Cstruct.t
| `Dir of Tree.t
| `Link of string
| `Exec of Cstruct.t ]
option ->
[ `Finish of 'a | `Again | `Abort ] or_error Lwt.t) ->
[ `Abort | `Finish of 'a ] or_error Lwt.t
wait_for_path
is similar to wait_for_head
, but waits for a particular sub-tree to change.
fast_forward t commit
changes t
to point to commit
if t
's head is an ancestor of commit
(or returns an error if not).
with_transaction t fn
is the result of applying fn
to a new transaction on branch t
. If the transaction has not been committed when fn trans
returns, the transaction is aborted (and a warning is logged). Use Transaction.abort
to avoid the warning.
val transaction : t -> Transaction.t or_error Lwt.t
transaction t
creates a new transaction on top of the branch t
. Must be closed with Transaction.abort
or Transaction.commit
. Use with_transaction
to not have to worry about resource leaks..