unison

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

globals.mli (3964B)


      1 (* Unison file synchronizer: src/globals.mli *)
      2 (* Copyright 1999-2020, Benjamin C. Pierce (see COPYING for details) *)
      3 
      4 (* Global variables and functions needed by top-level modules and user       *)
      5 (* interfaces                                                                *)
      6 
      7 (* The raw names of the roots as specified in the profile or on the command  *)
      8 (* line                                                                      *)
      9 val rawRoots : unit -> string list
     10 val setRawRoots : string list -> unit
     11 val rawRootPair : unit -> string * string
     12 
     13 (* Same as [rawRoots], parsed as clroots                                     *)
     14 val parsedClRawRoots : unit -> Clroot.clroot list
     15 
     16 (* Parse and canonize roots from their raw names                             *)
     17 val installRoots : (string -> Terminal.termInteract) option -> unit Lwt.t
     18 
     19 (* An alternate method (under development?) *)
     20 val installRoots2 : unit -> unit
     21 
     22 (* Clear previously installed roots; typically used when switching profiles  *)
     23 val uninstallRoots : unit -> unit
     24 
     25 (* The roots of the synchronization (with names canonized, but in the same   *)
     26 (* order as the user gave them)                                              *)
     27 val roots : unit -> Common.root * Common.root
     28 
     29 (* same thing, as a list                                                     *)
     30 val rootsList : unit -> Common.root list
     31 
     32 (* same thing, but in a standard order and ensuring that a Local root        *)
     33 (* comes first                                                               *)
     34 val rootsInCanonicalOrder : unit -> Common.root list
     35 
     36 (* a local root *)
     37 val localRoot : unit -> Common.root
     38 
     39 (* Run a command on all roots                                                *)
     40 val allRootsIter :
     41   (Common.root -> unit Lwt.t) -> unit Lwt.t
     42 
     43 (* Run a command on all roots                                                *)
     44 val allRootsIter2 :
     45   (Common.root -> 'a -> unit Lwt.t) -> 'a list ->
     46   unit Lwt.t
     47 
     48 (* Run a command on all roots and collect results                            *)
     49 val allRootsMap :
     50   (Common.root -> 'a Lwt.t) -> 'a list Lwt.t
     51 
     52 (* Run a command on all roots in parallel, and collect the results.          *)
     53 (* [allRootsMapWIthWaitingAction f wa] calls the function [wa] before        *)
     54 (* waiting for the result for the corresponding root.                        *)
     55 val allRootsMapWithWaitingAction:
     56     (Common.root -> 'a Lwt.t) -> (Common.root -> unit) -> 'a list Lwt.t
     57 
     58 (* The set of paths to synchronize within the replicas                       *)
     59 val paths : Path.t list Prefs.t
     60 
     61 (* Expand any paths ending with *                                            *)
     62 val expandWildcardPaths : unit -> unit
     63 
     64 (* Make sure that the server has the same settings for its preferences as we
     65    do locally.  Should be called whenever the local preferences have
     66    changed.  (This isn't conceptually a part of this module, but it can't
     67    live in the Prefs module because that would introduce a circular
     68    dependency.)                                                              *)
     69 val propagatePrefs : unit -> unit Lwt.t
     70 
     71 (* User preference: when true, don't ask any questions *)
     72 val batch : bool Prefs.t
     73 
     74 (* User preference: ask for confirmation when propagating a deletion of
     75    a whole replica or top-level path *)
     76 val confirmBigDeletes : bool Prefs.t
     77 
     78 (* Predicates on paths *)
     79 val shouldIgnore : 'a Path.path -> bool
     80 val shouldMerge : 'a Path.path -> bool
     81 val ignorePred : Pred.t
     82 val ignorenotPred : Pred.t
     83 val atomic : Pred.t
     84 
     85 (* Be careful calling this to add new patterns to be ignored: Its
     86    value does NOT persist when a new profile is loaded, so it has to
     87    be called again whenever this happens. *)
     88 val addRegexpToIgnore : string -> unit
     89 
     90 (* Merging commands *)
     91 val mergeCmdForPath : Path.t -> string
     92 
     93 (* Internal prefs, needed to know whether to do filenames checks *)
     94 val someHostIsRunningWindows : bool Prefs.t
     95 val allHostsAreRunningWindows : bool Prefs.t
     96 val fatFilesystem : bool Prefs.t