[GRASS-git] [OSGeo/grass] 26dd1f: grass.app: Move lock to mapset subcommand (#6437)

Vaclav Petras noreply at github.com
Mon Oct 6 16:17:30 PDT 2025


  Branch: refs/heads/main
  Home:   https://github.com/OSGeo/grass
  Commit: 26dd1f1a785ebd6a6cda13ec29dc19a0d36ad9b3
      https://github.com/OSGeo/grass/commit/26dd1f1a785ebd6a6cda13ec29dc19a0d36ad9b3
  Author: Vaclav Petras <wenzeslaus at gmail.com>
  Date:   2025-10-06 (Mon, 06 Oct 2025)

  Changed paths:
    M python/grass/app/cli.py
    M python/grass/app/tests/grass_app_cli_test.py

  Log Message:
  -----------
  grass.app: Move lock to mapset subcommand (#6437)

The lock and unlock subcommands are operating on a mapset and are low-level (they specifically just lock and unlock and don't do anything with any session). So, this is moving them under a new top-level subcommand mapset (from #6462).

With the lock subcommands being accessible outside of GRASS through CLI without a Python API or a GRASS tools (with or without #6442), other applications which can call subprocesses (such as QGIS) can use GRASS locking when accessing GRASS mapsets.

This is using the new structure in the cli.py file with parser definitions having their own functions (minimizing name conflicts between parses and keeping the main function short). Additionally, the interface and execution code are placed together because they would be changed at the same time.

Tests now test locking the the default mapset and a separate mapset in a smoke test fashion (more in-depth tests exist in the Python API).

Example: grass mapset lock /tmp/project_1/work_2



To unsubscribe from these emails, change your notification settings at https://github.com/OSGeo/grass/settings/notifications


More information about the grass-commit mailing list