grass.app: Add mapset create subcommand #6462
Merged
+114
−1
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
For symmetry with project create, this adds a new mapset create subcommand. The mapset subcommand can be used, similarly to project, to group operations related to mapsets.
Locking will be moved under mapset in #6437, so besides the availability of the subcommand for testing of other subcommands, the move of locking is the main motivation for adding the mapset create subcommand now.
The mapset creation uses the semi-internal function grass.grassdb.create.create_mapset. The function parameters were adjusted to allow for a single path being provided (which was already supported through path resolution function, but not supported though the parameters).
There are no parameters yet, and only basic creation and creation failure are handled (no computational region, overwrite, or search path). Tests cover creation and basic expectations of the new mapset, that is being separate from the default mapset, but part of the project.
Example
Assuming #6442:
Comparison with the classic CLI:
Similarly to the
project create
subcommand,mapset create
makes the create operation more clear, rather than driven by a flag (-c
) as additional operation to whatever is the main thing happening, it makes distinction between project and mapset creation explicit (not relying on the combination of path and CRS), and no-e
is required to avoid the interactive start. On the other hand, the three commands are always required for the above example (while the classic interface can do it in two, combining the mapset creation with the first tool run).