2021-02-05

(sph filesystem versioning)

gives a path to the next version of a file and automatically archives the old version.

part of sph-lib

library description

optionally depends on the "diff" and "patch" utilities for storing incremental changes.

# features

restore old versions

can use diff/patch files for previous versions for text files

limit the number of past versions to keep

size limit option to exclude big files from creating multiple versions

version identifiers are monotonically increasing integers in hexadecimal

module name

(sph filesystem versioning)

exported bindings

variable: sph-filesystem-versioning-description
procedure: versioning-create type path proc config ->
symbol:text/binary string procedure:{string ->} -> integer:current-version-id
calls \"proc\" with a path to an empty file which is the next version, and moves the old file to
the directory for previous versions which is set in \"config\".
if type is the symbol \"text\", then only the differences are stored in the previous version
variable: versioning-default-config
procedure: versioning-restore type path version-id config ->
symbol:text/binary string integer -> string
result in a path to a file which is \"path\" at version \"version-id\".
the result path is not necessarily a copy