From c606c6a17bfbe85c8dac20b9b1a76dee2a4fa5f2 Mon Sep 17 00:00:00 2001 From: Adam Coldrick Date: Mon, 14 Apr 2014 16:45:37 +0000 Subject: 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. --- morphlib/plugins/branch_and_merge_new_plugin.py | 10 +++++----- 1 file 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): -- cgit v1.2.1