diff options
author | Jonathan Maw <jonathan.maw@codethink.co.uk> | 2013-03-15 13:13:56 +0000 |
---|---|---|
committer | Jonathan Maw <jonathan.maw@codethink.co.uk> | 2013-03-15 13:13:56 +0000 |
commit | dc692f92dca17b830099e916311368ac85a3a8b6 (patch) | |
tree | b333883e1a4cd6d2b6c43d3fc86eae526695a223 | |
parent | 38e1c6a14c5ceb21b475f4acc2534854759f1274 (diff) | |
parent | 5b5f4a0ef4d7a04b97ccb906ec2c1b8fe66f891e (diff) | |
download | morph-dc692f92dca17b830099e916311368ac85a3a8b6.tar.gz |
Merge branch 'baserock/richardholland/add-metadata-dir-setting-to-branch-from-image'
Reviewed-by: Jonathan Maw <jonathan.maw@codethink.co.uk>
-rw-r--r-- | morphlib/plugins/branch_and_merge_plugin.py | 11 | ||||
-rwxr-xr-x | tests.as-root/branch-from-image-works.script | 2 |
2 files changed, 10 insertions, 3 deletions
diff --git a/morphlib/plugins/branch_and_merge_plugin.py b/morphlib/plugins/branch_and_merge_plugin.py index 141c3187..32158a88 100644 --- a/morphlib/plugins/branch_and_merge_plugin.py +++ b/morphlib/plugins/branch_and_merge_plugin.py @@ -73,7 +73,14 @@ class BranchAndMergePlugin(cliapp.Plugin): arg_synopsis='SYSTEM') self.app.add_subcommand('status', self.status) self.app.add_subcommand('branch-from-image', self.branch_from_image, - arg_synopsis='REPO BRANCH [METADATADIR]') + arg_synopsis='REPO BRANCH') + group_branch = 'Branching Options' + self.app.settings.string(['metadata-dir'], + 'Set metadata location for branch-from-image' + ' (default: /baserock)', + metavar='DIR', + default='/baserock', + group=group_branch) # Advanced commands self.app.add_subcommand('foreach', self.foreach, @@ -859,7 +866,7 @@ class BranchAndMergePlugin(cliapp.Plugin): 'branch-from-image needs repository, ref and path to metadata') root_repo = args[0] branch = args[1] - metadata_path = '/baserock' if len(args) == 2 else args[2] + metadata_path = self.app.settings['metadata-dir'] workspace = self.deduce_workspace() self.lrc, self.rrc = morphlib.util.new_repo_caches(self.app) diff --git a/tests.as-root/branch-from-image-works.script b/tests.as-root/branch-from-image-works.script index 1d694e9b..9afab661 100755 --- a/tests.as-root/branch-from-image-works.script +++ b/tests.as-root/branch-from-image-works.script @@ -49,7 +49,7 @@ workspace="$DATADIR/workspace" "$SRCDIR/scripts/test-morph" init "$workspace" cd "$workspace" "$SRCDIR/scripts/test-morph" branch-from-image \ - test:morphs mybranch "$extracted/baserock" + test:morphs mybranch --metadata-dir="$extracted/baserock" cd mybranch/test:morphs grep -qFe "$hello_chunk_commit" hello-stratum.morph tar=$("$SRCDIR/scripts/test-morph" --find-system-artifact build hello-tarball) |