Files @ 304aae43194c
Branch filter:

Location: kallithea/docs/usage/locking.rst - annotation

304aae43194c 1.1 KiB text/prs.fallenstein.rst Show Source Show as Raw Download as Raw
Mads Kiilerich
gearbox: fix setup-db failure when db is created for the first time (Issue #272)

The port to TG2 in e1ab82613133 replaced pylonsconfig.init_app for gearbox
commands with middleware setup code. That introduced reading of the database
for commands that don't need a database - for example the command for creating
databases ... which thus failed.

To fix that, move the middleware setup with database access so it only is run
for gearbox command that requires a db session. There is apparently no need for
a direct replacement for pylonsconfig.init_app .
.. _locking:

==================
Repository locking
==================

Kallithea has a *repository locking* feature, disabled by default. When
enabled, every initial clone and every pull gives users (with write permission)
the exclusive right to do a push.

When repository locking is enabled, repositories get a ``locked`` flag.
The hg/git commands ``hg/git clone``, ``hg/git pull``,
and ``hg/git push`` influence this state:

- A ``clone`` or ``pull`` action locks the target repository
  if the user has write/admin permissions on this repository.

- Kallithea will remember the user who locked the repository so only this
  specific user can unlock the repo by performing a ``push``
  command.

- Every other command on a locked repository from this user and every command
  from any other user will result in an HTTP return code 423 (Locked).
  Additionally, the HTTP error will mention the user that locked the repository
  (e.g., “repository <repo> locked by user <user>”).

Each repository can be manually unlocked by an administrator from the
repository settings menu.