summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdam Coldrick <adam.coldrick@codethink.co.uk>2014-04-14 16:45:37 +0000
committerAdam Coldrick <adam.coldrick@codethink.co.uk>2014-04-15 09:20:28 +0000
commitc606c6a17bfbe85c8dac20b9b1a76dee2a4fa5f2 (patch)
tree862f8f8ea5273ac8db391dfffc09edb970343610
parentfa3c32475625d1bbf52c81600fa94f96dabfa246 (diff)
downloadmorph-baserock/adamcoldrick/chunks-in-defs-with-morph-edit-changes.tar.gz
Make morph look for system morphologies in subdirectories of the system branch root repository checkout, in case the repository contains all its system morphologies in a specific subdirectory.
-rw-r--r--morphlib/plugins/branch_and_merge_new_plugin.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/morphlib/plugins/branch_and_merge_new_plugin.py b/morphlib/plugins/branch_and_merge_new_plugin.py
index 5ff9e34d..32b769cd 100644
--- a/morphlib/plugins/branch_and_merge_new_plugin.py
+++ b/morphlib/plugins/branch_and_merge_new_plugin.py
@@ -197,7 +197,6 @@ class SimpleBranchAndMergePlugin(cliapp.Plugin):
if not self._checkout_has_systems(gd):
raise BranchRootHasNoSystemsError(root_url, base_ref)
-
def branch(self, args):
'''Create a new system branch.
@@ -529,10 +528,11 @@ class SimpleBranchAndMergePlugin(cliapp.Plugin):
@staticmethod
def _checkout_has_systems(gd):
loader = morphlib.morphloader.MorphologyLoader()
- for filename in glob.iglob(os.path.join(gd.dirname, '*.morph')):
- m = loader.load_from_file(filename)
- if m['kind'] == 'system':
- return True
+ for filename in gd.list_files():
+ if filename.endswith('.morph'):
+ m = loader.load_from_file(gd.join_path(filename))
+ if m['kind'] == 'system':
+ return True
return False
def foreach(self, args):