Besides refactoring code into smaller functions:
- Makes the --rebase behaviour the default for consistency: it was
already rebasing when current branch and revision are the same, it is
less confusing to rebase when they are different too.
- Add --reset mode that checkout the new branch and hard reset that
branch to remote commit. This new mode guarantees that every
subproject are exactly at the wrap's revision.
- Local changes are always stashed first to avoid any data loss. In the
worst case scenario the user can always check reflog and stash list to
rollback.
Fixes: #7526
If the command fails on some subprojects continue with the rest but
return non-0 code. This is useful for CI scripts to ensure it tests
latest code instead of old cached code in case of network error or
something.
Add '--cross-only' option to run_tests.py, so we can arrange not to run
tests in the 'native' suite when only a cross-compiler is available, as
they can't succeed.
Split out tests (and parts of tests) which require a native compiler
from the 'common' suite to a new suite called 'native', so we can
selectively avoid running those tests when only a cross-compiler is
available.
Also move test '211 cmake module' to 'cmake' suite, since it appears
that the way we use cmake requires a native compiler.
Don't stop generating STATIC_LINKER rules at the first MachineChoice
which isn't available (i.e. generate a STATIC_LINKER rule, even if
STATIC_LINKER_FOR_BUILD isn't needed)
Also warn about internal errors which lead to non-existent rule
references, rather than exploding with a KeyError.
This means that, in the common case of a simple meson.build which
doesn't contain any 'native: true' targets, we won't require a native
compiler when cross-compiling, without needing any changes in the
meson.build.
If the meson.build doesn't use a native compiler, the native compiler
options (e.g. 'c_args') shouldn't be present in the output of 'meson
introspect --buildoptions'.