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.
This adds --tmp-mapset to the main executable which creates a temporary mapset
in the location specified in the command line. Intended to be used with --exec
and documented that way, but not explicitly checked, so --tmp-mapset without
--exec is possible for experimental purposes (same as --tmp-location).
It handles error states related to common mistakes (and gives suggestions
to user what might be wrong if that info is available).
It also handles errors caused by interaction with -c and --tmp-location.
Documentation (HTML and --help) follows what was already done for --tmp-location
and modifies doc for --tmp-location to make the differences clear, although
providing a set of specific use cases for each might help further.
Test (a first automated test in lib/init) does not fully conform to the current
GRASS GIS standard. It is using the plain Python unittest and not the GRASS GIS extension
of it (grass.gunittest). For this test, the differences in code are minimal,
but the test does not need functions from grass.gunittest nor its setup of
temporary mapset (meant for modules). As a result of using plain unittest,
this test runs outside of the GRASS GIS session. However, it still needs
to know about the tested executable which, if not already available, needs to be put
on PATH as grass (given what is hardcoded in the test now).
A smaller rewrite of some of the code for checking and setting up mapset
was necessary in order to accommodate the new code, specifically the
initial splitting of provided path and diagnostic of invalid location path.
However, adding notes to the code to facilitate further rewrite which is due.