Up

module Sync

: sig

Clone/Fecth/Push protocol

#
module Result : sig
#
type fetch = {
# head
: SHA.Commit.t option;
# references
: SHA.Commit.t Reference.Map.t;
# sha1s
: SHA.t list;
}

The resulting sha1s and references.

#
val pretty_fetch : fetch -> string

Pretty print a fetch result.

#
type ok_or_error = [
| `Ok
| `Error of string
]
#
type push = {
# result
: ok_or_error;
# commands
: (Reference.t * ok_or_error) list;
}

The result of a push operation.

#
val pretty_push : push -> string

Pretty print a push status.

end
#
module type S = sig
#
type t

Abstract value for stores.

#
val ls : t -> Gri.t -> SHA.Commit.t Reference.Map.t Lwt.t

List the references of the remote repository.

#
val push : t -> branch:Reference.t -> Gri.t -> Result.push Lwt.t

Push a local branch to a remote store.

#
val clone : t -> ?deepen:int -> ?unpack:bool -> Gri.t -> Result.fetch Lwt.t

clone t address clones the contents of address into the store t.

#
val fetch : t -> ?deepen:int -> ?unpack:bool -> Gri.t -> Result.fetch Lwt.t

fetch t address fetches the missing contents of address into the store t.

end

Constructor

#
module type IO = sig

Channel abstraction.

#
type ic

Type for input channels.

#
type oc

Type for output channels.

#
val with_connection : Uri.t -> ?init:string -> (ic * oc -> 'a Lwt.t) -> 'a Lwt.t

Connect to a remote server, get the corresponding input and output channels and apply a function on them. Close the channel once the function returns. The init corresponds to an optional first message sent on the connection to set-it up.

#
val read_all : ic -> string Lwt.t

Read all the channel contents (until the channel is closed by the other side).

#
val read_exactly : ic -> int -> string Lwt.t

Read a given number of bits.

#
val write : oc -> string -> unit Lwt.t

Write a string on a channel.

#
val flush : oc -> unit Lwt.t

Flush the channel.

end
#
module Make : functor (IO : IO) -> functor (S : Store.S) -> S with type t = S.t
end