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§
- Check
InOutcome - Result of the bulk check-in for one revision.
- Client
File - A file of the client’s workspace, as the client reports it.
- File
Status - One file of a revision with its server state and – if the client reported its workspace – the sync state of the local copy.
- Released
Checkout - A forced release of the actor’s own check-out (
revision.checkout_forced_release). - Revision
Status - 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_heldrun 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
clientlist only the server side is returned (state=None). - held_
count - How many revisions
holderhas checked out that the actor may read – the numberrelease_heldwould look at for an administrator. - release_
held - Releases the check-outs
holderstill has – in every group, or only inproject– for a leaver (issue #173). Each release goes throughrevisions::cancel_checkoutin 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_heldwith 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 ofrev, 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 byrevisions::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.