unison

Fork of Unison, a bi-directional file synchronization tool
git clone git://git.laack.co/unison.git
Log | Files | Refs | README | LICENSE

update.mli (4066B)


      1 (* Unison file synchronizer: src/update.mli *)
      2 (* Copyright 1999-2020, Benjamin C. Pierce (see COPYING for details) *)
      3 
      4 module NameMap : MyMap.S with type key = Name.t
      5 
      6 type archive251 =
      7     ArchiveDir of Props.t251 * archive251 NameMap.t
      8   | ArchiveFile of Props.t251 * Os.fullfingerprint * Fileinfo.stamp251 * Osx.ressStamp
      9   | ArchiveSymlink of string
     10   | NoArchive
     11 
     12 type archive =
     13     ArchiveDir of Props.t * archive NameMap.t
     14   | ArchiveFile of Props.t * Os.fullfingerprint * Fileinfo.stamp * Osx.ressStamp
     15   | ArchiveSymlink of string
     16   | NoArchive
     17 
     18 val marchive : archive Umarshal.t
     19 
     20 val to_compat251 : archive -> archive251
     21 val of_compat251 : archive251 -> archive
     22 
     23 (* Calculate a canonical name for the set of roots to be synchronized.  This
     24    will be used in constructing the archive name for each root. Note, all
     25    the roots in this canonical name will contain hostnames, even local
     26    roots, so the roots are re-sorted. *)
     27 val storeRootsName : unit -> unit
     28 
     29 (* Retrieve the actual names of the roots *)
     30 val getRootsName : unit -> string
     31 
     32 (* Perform update detection. Optionally, takes as input the list of
     33    paths known not to be synchronized and a list of paths not to
     34    check. Returns structures describing dirty files/dirs (1 per path
     35    given in the -path preference). An option controls whether we
     36    would like to use the external filesystem monitoring process. *)
     37 val findUpdates :
     38   ?wantWatcher:bool ->
     39   (Path.t list * Path.t list) option ->
     40   ((Path.local * Common.updateItem * Props.t list) *
     41       (Path.local * Common.updateItem * Props.t list)) list
     42 
     43 (* Take a tree of equal update contents and update the archive accordingly. *)
     44 val markEqual :
     45   (Name.t * Name.t, Common.updateContent * Common.updateContent) Tree.t -> unit
     46 
     47 (* Get and update a part of an archive (the archive remains unchanged) *)
     48 val updateArchive : Fspath.t -> Path.local -> Common.updateItem -> archive
     49 (* Replace a part of an archive by another archive *)
     50 val replaceArchive : Common.root -> Path.t -> archive -> unit Lwt.t
     51 val replaceArchiveLocal : Fspath.t -> Path.local -> archive -> unit
     52 (* Update only some permissions *)
     53 val updateProps :
     54   Fspath.t -> 'a Path.path -> Props.t option -> Common.updateItem -> unit
     55 
     56 (* Check that no updates has taken place in a given place of the filesystem *)
     57 (* Returns an archive mirroring the filesystem contents *)
     58 val checkNoUpdates :
     59   Fspath.t -> Path.local -> Common.updateItem -> archive
     60 
     61 (* Turn off fastcheck for the given file on the next sync. *)
     62 val markPossiblyUpdated : Fspath.t -> Path.local -> unit
     63 
     64 (* Save to disk the archive updates *)
     65 val commitUpdates : unit -> unit
     66 
     67 (* In the user interface, it's helpful to know whether unison was started
     68    with no archives.  (Then we can display file status as 'unknown' rather
     69    than 'new', which seems friendlier for new users.)  This flag gets set
     70    false by the crash recovery code when it determines that no archives were
     71    present. *)
     72 val foundArchives : bool ref
     73 
     74 (* Unlock the archives, if they are locked. *)
     75 val unlockArchives : unit -> unit Lwt.t
     76 
     77 (* Translate a global path into a local path using the archive *)
     78 val translatePath : Common.root -> Path.t -> Path.local Lwt.t
     79 val translatePathLocal : Fspath.t -> Path.t -> Path.local
     80 
     81 (* Are we checking fast, or carefully? *)
     82 val useFastChecking : unit -> bool
     83 
     84 (* Print the archive to the current formatter (see Format) *)
     85 val showArchive: archive -> unit
     86 
     87 (* Compute the size of an update *)
     88 val updateSize : Path.t -> Common.updateItem -> int * Uutil.Filesize.t
     89 
     90 (* Iterate on all files in an archive *)
     91 val iterFiles :
     92   Fspath.t -> Path.local -> archive ->
     93   (Fspath.t -> Path.local -> Os.fullfingerprint -> unit) -> unit
     94 
     95 (* (For breaking the dependency loop between update.ml and stasher.ml...) *)
     96 val setStasherFun : (Fspath.t -> Path.local -> unit) -> unit
     97 
     98 (* Conjoin the canonical name of the current host and the canonical
     99    presentation of the current fspath with the list of names/fspaths of
    100    all the roots and the current archive format *)
    101 val archiveHash : Fspath.t -> string