summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Sherwood <paul.sherwood@codethink.co.uk>2014-06-08 11:50:08 +0000
committerPaul Sherwood <paul.sherwood@codethink.co.uk>2014-06-08 12:07:04 +0000
commit901e79ec9020bc810230625ba824321379f24b85 (patch)
tree8aab56884477df3debb5f32dae6a2be251fab3f4
parentce779c2b6883fbc83f9bae72d4a97f4a8c823ccc (diff)
downloadmorph-901e79ec9020bc810230625ba824321379f24b85.tar.gz
Add messages to help user know what is happening
-rw-r--r--morphlib/plugins/branch_and_merge_new_plugin.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/morphlib/plugins/branch_and_merge_new_plugin.py b/morphlib/plugins/branch_and_merge_new_plugin.py
index 7191979b..af3f9665 100644
--- a/morphlib/plugins/branch_and_merge_new_plugin.py
+++ b/morphlib/plugins/branch_and_merge_new_plugin.py
@@ -381,10 +381,13 @@ class SimpleBranchAndMergePlugin(cliapp.Plugin):
loader = morphlib.morphloader.MorphologyLoader()
morphs = self._load_all_sysbranch_morphologies(sb, loader)
+ found = 0
+
for morph in morphs.morphologies:
if morph['kind'] == 'stratum':
for chunk in morph['chunks']:
if chunk['name'] == chunk_name:
+ found = found + 1
self.app.status(
msg='Editing %(chunk)s in %(stratum)s stratum',
chunk=chunk_name, stratum=morph['name'])
@@ -418,6 +421,19 @@ class SimpleBranchAndMergePlugin(cliapp.Plugin):
self._save_dirty_morphologies(loader, sb, morphs.morphologies)
+ if found == 0:
+ self.app.status(msg="No chunk %(chunk)s found. If you want "
+ "to create one, add an entry to a stratum morph file.",
+ chunk=chunk_name)
+
+ if found >= 1:
+ self.app.status(msg="Chunk %(chunk)s source is available at "
+ "%(dir)s", chunk=chunk_name, dir=chunk_dirname)
+
+ if found > 1:
+ self.app.status(msg="Notice that this chunk appears in "
+ "more than one stratum")
+
def show_system_branch(self, args):
'''Show the name of the current system branch.'''