From e336c186ca44ea640206eb3cb626a92fcc1dde2b Mon Sep 17 00:00:00 2001 From: Pedro Alvarez Date: Wed, 27 Jul 2016 00:23:02 +0000 Subject: Add support for '--repo' and '--ref' in list-artifacts Change-Id: I48cebf0007e602c0262b667643c3290d41c7b485 --- morphlib/plugins/list_artifacts_plugin.py | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/morphlib/plugins/list_artifacts_plugin.py b/morphlib/plugins/list_artifacts_plugin.py index 9e09e2b9..e28b7e42 100644 --- a/morphlib/plugins/list_artifacts_plugin.py +++ b/morphlib/plugins/list_artifacts_plugin.py @@ -38,11 +38,22 @@ class ListArtifactsPlugin(cliapp.Plugin): Command line arguments: - * `MORPH` is a system morphology name at that ref. + * `MORPH` is a system morphology name in the checked-out repository + or in a remote repostory. + + Available options: + + * `--repo=REPO`` is a git repository URL. + * `--ref=REF` is a branch or other commit reference in that repository. + * `--local-changes=LOCAL-CHANGES` option to `ignore` or `include` + uncommitted/unpushed local changes. You can pass multiple values for `MORPH`, in which case the command outputs the union of the build graphs of all the systems passed in. + If not `REPO` and `REF` specified, it will look into the current + working directory for a Definitions checkout. + The output includes any meta-artifacts such as .meta and .build-log files. @@ -55,6 +66,20 @@ class ListArtifactsPlugin(cliapp.Plugin): 'Wrong number of arguments to list-artifacts command ' '(see help)') + + repo = self.app.settings['repo'] + ref = self.app.settings['ref'] + + if bool(repo) ^ bool(ref): + raise cliapp.AppException( + '--repo and --ref work toghether, use both please.') + + if repo and ref: + system_filenames = map(morphlib.util.sanitise_morphology_path, + args) + self._list_artifacts(repo, ref, system_filenames) + return + definitions_repo = morphlib.definitions_repo.open( '.', search_for_root=True, app=self.app) -- cgit v1.2.1