locking.rst
38 lines
| 1.3 KiB
| text/x-rst
|
RstLexer
r2726 | .. _locking: | |||
=================================== | ||||
Bradley M. Kuhn
|
r4192 | Kallithea repository locking system | ||
r2726 | =================================== | |||
Mads Kiilerich
|
r4902 | The scenario for repos with `locking function` enabled is that | ||
every initial clone and every pull gives users (with write permission) | ||||
the exclusive right to do a push. | ||||
Each repo can be manually unlocked by admin from the repo settings menu. | ||||
r3224 | | Repos with **locking function=disabled** is the default, that's how repos work | |||
r2726 | today. | |||
| Repos with **locking function=enabled** behaves like follows: | ||||
Repos have a state called `locked` that can be true or false. | ||||
r3224 | The hg/git commands `hg/git clone`, `hg/git pull`, and `hg/git push` | |||
r2726 | influence this state: | |||
r3224 | - The command `hg/git pull <repo>` will lock that repo (locked=true) | |||
r2726 | if the user has write/admin permissions on this repo | |||
r3224 | - The command `hg/git clone <repo>` will lock that repo (locked=true) if the | |||
r2726 | user has write/admin permissions on this repo | |||
Mads Kiilerich
|
r4902 | Kallithea will remember the user id who locked the repo so | ||
r3224 | only this specific user can unlock the repo (locked=false) by calling | |||
r2726 | ||||
r3224 | - `hg/git push <repo>` | |||
r2726 | ||||
Mads Kiilerich
|
r4902 | Every other command on that repo from this user and | ||
every command from any other user will result in http return code 423 (locked). | ||||
r2726 | ||||
Mads Kiilerich
|
r4902 | Additionally, the http error includes the <user> that locked the repo | ||
(e.g. “repository <repo> locked by user <user>”). | ||||