Skip to main content

Module checkouts

Module checkouts 

Source
Expand description

Concurrency management around check-outs: the sync state of the files of a revision as a client’s workspace sees them, and the bulk check-in of everything a user has checked out.

The lock itself (revisions::checkout / cancel_checkout) and the optimistic base-version guard of uploads (files::store_uploads) live in their own services; this module combines them for the workspace views.

Structs§

CheckInOutcome
Result of the bulk check-in for one revision.
ClientFile
A file of the client’s workspace, as the client reports it.
FileStatus
One file of a revision with its server state and – if the client reported its workspace – the sync state of the local copy.
ReleasedCheckout
A forced release of the actor’s own check-out (revision.checkout_forced_release).
RevisionStatus
The files of a revision and who holds its lock.

Constants§

BULK_COMMENT
The comment of every check-in of check_in_all (shown in the audit log).
MAX_RELEASE
Most check-outs one release_held run releases.

Functions§

check_in_all
Checks in every revision the actor has checked out – or only those of only – without new files: the lock is released, the revision keeps its files. Each revision is checked in in its own transaction with its own audit record (revision.checkin), so one failure does not block the others; the outcome lists every revision. Clients with a local workspace (desktop) pass only the revisions without local changes.
file_status
The status of every file of a revision for one workspace. With an empty client list only the server side is returned (state = None).
held_count
How many revisions holder has checked out that the actor may read – the number release_held would look at for an administrator.
release_held
Releases the check-outs holder still has – in every group, or only in project – for a leaver (issue #173). Each release goes through revisions::cancel_checkout in its own transaction, so the permission rule stays in one place, every release is audited (revision.checkout_forced_release) and one refusal does not stop the others; the outcome lists every revision.
release_held_because
release_held with a reason for every release: a manager then also releases the check-outs of an active member of their groups (issue #173, the season handover); the reason is audited and told to the holder.
release_summary
"Released 4 check-outs; 1 refused: PRT-000003/A (…)" for a flash message.
released_from
The forced release of actor’s check-out of rev, if that is the last thing that happened to its lock and it is not checked out now. Read from the audit log (details.holder, written by revisions::cancel_checkout), so it needs no state of its own; releases audited before the holder was recorded are not reported.
released_message
What the former holder of a released check-out is told in the working folder: their local files are not touched, but checking them in needs the lock again.
summary
"Checked in 4 revisions; 1 failed: PRT-000003/A (…)" for a flash message.