Skip to content

Add mepo reset command

Compare
Choose a tag to compare
@mathomp4 mathomp4 released this 09 Dec 19:21
· 37 commits to main since this release
09018c2

DOI

This release adds a new mepo reset command:

❯ mepo reset -h
usage: mepo reset [-h] [-f] [--reclone] [-n]

Reset the current mepo clone to the original state.This will delete all subrepos and does not check for uncommitted changes! Must be run in the root of
the mepo clone.

options:
  -h, --help     show this help message and exit
  -f, --force    Force action.
  --reclone      Reclone repos after reset.
  -n, --dry-run  Dry-run only

By default, it will not re-clone a repo and will require a user to answer another question to run (without force flag):

❯ mepo clone
Initializing mepo using components.yaml
ESMA_env   | (t) v4.8.0
ESMA_cmake | (t) v3.21.0
ecbuild    | (t) geos/v1.3.0
❯ mepo reset
Are you sure you want to reset the project? If so, type 'yes' and press enter. yes
Removing ESMA_cmake/ecbuild...done.
Removing ESMA_cmake...done.
Removing ESMA_env...done.
Removing .mepo...done.
❯ ls -1 ESMA_env | head -1
ls: ESMA_env: No such file or directory

You can do a reclone with --reclone:

❯ mepo clone
Initializing mepo using components.yaml
ESMA_env   | (t) v4.8.0
ESMA_cmake | (t) v3.21.0
ecbuild    | (t) geos/v1.3.0
❯ mepo reset --reclone -f
Removing ESMA_cmake/ecbuild...done.
Removing ESMA_cmake...done.
Removing ESMA_env...done.
Removing .mepo...done.
Re-cloning all subrepos
Initializing mepo using components.yaml
ESMA_env   | (t) v4.8.0
ESMA_cmake | (t) v3.21.0
ecbuild    | (t) geos/v1.3.0
Recloning done.
❯ ls -1 ESMA_env | head -1
BASEDIR.rc.in

Note we also require the user to be in the root of a fixture:

❯ mepo clone
Initializing mepo using components.yaml
ESMA_env   | (t) v4.8.0
ESMA_cmake | (t) v3.21.0
ecbuild    | (t) geos/v1.3.0
❯ cd ESMA_cmake/ecbuild
❯ mepo reset
Error! As a safety precaution, you must be in the root directory of the project to reset

What's Changed

Full Changelog: v1.47.0...v1.48.0