summaryrefslogtreecommitdiff
path: root/morphlib/plugins/get_chunk_details_plugin.py
diff options
context:
space:
mode:
authorSam Thursfield <sam.thursfield@codethink.co.uk>2015-06-18 17:08:53 +0100
committerPedro Alvarez <pedro.alvarez@codethink.co.uk>2015-06-22 13:12:37 +0000
commitb18764f144983dfb9aa892892084af1daeb9100d (patch)
treea9529d65053b918451b79c66f17c9f59137605b3 /morphlib/plugins/get_chunk_details_plugin.py
parent26dce1d6ef83294c184fc513232130dbbd8f19dc (diff)
downloadmorph-b18764f144983dfb9aa892892084af1daeb9100d.tar.gz
Make more commands work outside a system-branch/workspace
This makes `morph get-chunk-details`, `morph get-repo` and `morph show-build-log` work in any Git checkout of definitions.git. These are all of the commands outside of the deprecated branch_and_merge_plugin that take notice of system branches. The DefinitionsRepo.relative_path_to_chunk() function is changed a bit. It actually only existed for the `get-repo` command to use, but it turns out that it did the wrong thing by returning a long path for the repo (e.g. baserock/baserock/fhs-dirs) instead of a short one (fhs-dirs). The latter is less typing, and is the behaviour expected by the `get-repo` yarn tests, so it now does that. Change-Id: I430b540b3b0f309cf7018e0b8236f0e8a9042d89
Diffstat (limited to 'morphlib/plugins/get_chunk_details_plugin.py')
-rw-r--r--morphlib/plugins/get_chunk_details_plugin.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/morphlib/plugins/get_chunk_details_plugin.py b/morphlib/plugins/get_chunk_details_plugin.py
index 842b4afe..e58ed6c5 100644
--- a/morphlib/plugins/get_chunk_details_plugin.py
+++ b/morphlib/plugins/get_chunk_details_plugin.py
@@ -47,14 +47,15 @@ class GetChunkDetailsPlugin(cliapp.Plugin):
'Wrong number of arguments to get-chunk-details command '
'(see help)')
- sb = morphlib.sysbranchdir.open_from_within('.')
+ definitions_repo = morphlib.definitions_repo.open(
+ '.', search_for_root=True, search_workspace=True, app=self.app)
loader = morphlib.morphloader.MorphologyLoader()
aliases = self.app.settings['repo-alias']
self.resolver = morphlib.repoaliasresolver.RepoAliasResolver(aliases)
found = 0
- for morph in sb.load_all_morphologies(loader):
+ for morph in definitions_repo.load_all_morphologies(loader):
if morph['kind'] == 'stratum':
if (stratum_name == None or
morph['name'] == stratum_name):