unison

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

stasher.mli (1342B)


      1 (* Unison file synchronizer: src/stasher.mli *)
      2 (* Copyright 1999-2020 (see COPYING for details) *)
      3 
      4 (* This module maintains backups for general purpose and *)
      5 (* as archives for mergeable files. *)
      6 
      7 (* Make a backup copy of a file, if needed; if the third parameter is
      8    `AndRemove, then the file is either backed up by renaming or else
      9    deleted if no backup is needed. *)
     10 val backup:
     11   Fspath.t -> Path.local ->
     12   [`AndRemove | `ByCopying] -> Update.archive -> unit
     13 
     14 (* Stashes of current versions (so that we have archives when needed for merging) *)
     15 val stashCurrentVersion:
     16       Fspath.t                (* fspath to stash *)
     17    -> Path.local              (* path to stash *)
     18    -> Path.local option       (* path to actual bits to be stashed (used to stash an
     19                                  additional archive version in addition to the current version) *)
     20    -> unit
     21 
     22 (* Retrieve a stashed version *)
     23 val getRecentVersion:
     24        Fspath.t
     25     -> Path.local
     26     -> Os.fullfingerprint
     27     -> Fspath.t option
     28 
     29 (* Return the location of the backup directory *)
     30 val backupDirectory : unit -> Fspath.t
     31 
     32 (* Check whether current version of a path is being stashed *)
     33 val shouldBackupCurrent : Path.t -> bool
     34 
     35 (* Low-level backupdir preference *)
     36 val backupdir : string Prefs.t
     37 
     38 (* Initialize the module *)
     39 val initBackups: unit -> unit