Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source
Source file sync_ext_intf.ml
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596(*
* Copyright (c) 2013-2017 Thomas Gazagnaire <thomas@gazagnaire.org>
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*)openSmoduletypeSYNC_STORE=sig(** {1 Native Synchronization} *)typedb(** Type type for store handles. *)typecommit(** The type for store heads. *)typestatus=[`Empty|`Headofcommit](** The type for remote status. *)valstatus_t:db->statusType.t(** [status_t db] is the value type for {!status} of remote [db]. *)valpp_status:statusFmt.t(** [pp_status] pretty-prints return statuses. *)valfetch:db->?depth:int->remote->(status,[`Msgofstring])resultLwt.t(** [fetch t ?depth r] populate the local store [t] with objects for the
remote store [r], using [t]'s current branch. The [depth] parameter limits
the history depth. Return [`Empty] if either the local or remote store do
not have a valid head. *)valfetch_exn:db->?depth:int->remote->statusLwt.t(** Same as {!fetch} but raise [Invalid_argument] if either the local or
remote store do not have a valid head. *)typepull_error=[`Msgofstring|Merge.conflict](** The type for pull errors. *)valpp_pull_error:pull_errorFmt.t(** [pp_push_error] pretty-prints pull errors. *)valpull:db->?depth:int->remote->[`MergeofInfo.f|`Set]->(status,pull_error)resultLwt.t(** [pull t ?depth r s] is similar to {{!Sync.fetch} fetch} but it also
updates [t]'s current branch. [s] is the update strategy:
- [`Merge] uses [Head.merge]. Can return a conflict.
- [`Set] uses [S.Head.set]. *)valpull_exn:db->?depth:int->remote->[`MergeofInfo.f|`Set]->statusLwt.t(** Same as {!pull} but raise [Invalid_arg] in case of conflict. *)typepush_error=[`Msgofstring|`Detached_head](** The type for push errors. *)valpp_push_error:push_errorFmt.t(** [pp_push_error] pretty-prints push errors. *)valpush:db->?depth:int->remote->(status,push_error)resultLwt.t(** [push t ?depth r] populates the remote store [r] with objects from the
current store [t], using [t]'s current branch. If [b] is [t]'s current
branch, [push] also updates the head of [b] in [r] to be the same as in
[t].
{b Note:} {e Git} semantics is to update [b] only if the new head if more
recent. This is not the case in {e Irmin}. *)valpush_exn:db->?depth:int->remote->statusLwt.t(** Same as {!push} but raise [Invalid_argument] if an error happens. *)endmoduletypeSync_ext=sigmoduletypeSYNC_STORE=SYNC_STOREvalremote_store:(moduleStore.Swithtypet='a)->'a->remotemoduleMake(X:Store.S):SYNC_STOREwithtypedb=X.tandtypecommit=X.commitend