diff options
author | Adam Coldrick <adam.coldrick@codethink.co.uk> | 2014-04-14 16:45:37 +0000 |
---|---|---|
committer | Adam Coldrick <adam.coldrick@codethink.co.uk> | 2014-04-15 15:43:45 +0000 |
commit | 94bb7c071b94f75453ed6da774046c490c79d92e (patch) | |
tree | ca3e924ed59a424a2532ccd4657d7aecd2f770e7 | |
parent | 8e7dc706a11709a3179b3cf4392d60c2604d861c (diff) | |
download | morph-94bb7c071b94f75453ed6da774046c490c79d92e.tar.gz |
Check for systems in subdirectories
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.py | 10 |
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 0650ce85..03467fd4 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. @@ -560,10 +559,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): |