From d2a58462e6b2ffab0d636b1575c46a58099a82b7 Mon Sep 17 00:00:00 2001 From: Richard Maw Date: Wed, 18 Jun 2014 14:39:04 +0000 Subject: Remove check on checkout/branch that there are systems This was the wrong response to the problem of accidentally checking-out morph when trying to check out morphs. Now that it's called definitions, this is irrelevent, and aborting a checkout when this check fails is the wrong thing to do. --- morphlib/plugins/branch_and_merge_new_plugin.py | 22 ---------------------- 1 file changed, 22 deletions(-) (limited to 'morphlib') diff --git a/morphlib/plugins/branch_and_merge_new_plugin.py b/morphlib/plugins/branch_and_merge_new_plugin.py index d6556b7b..27b12fe7 100644 --- a/morphlib/plugins/branch_and_merge_new_plugin.py +++ b/morphlib/plugins/branch_and_merge_new_plugin.py @@ -24,13 +24,6 @@ import shutil import morphlib -class BranchRootHasNoSystemsError(cliapp.AppException): - def __init__(self, repo, ref): - cliapp.AppException.__init__( - self, 'System branch root repository %s ' - 'has no system morphologies at ref %s' % (repo, ref)) - - class SimpleBranchAndMergePlugin(cliapp.Plugin): '''Add subcommands for handling workspaces and system branches.''' @@ -194,9 +187,6 @@ class SimpleBranchAndMergePlugin(cliapp.Plugin): gd.fat_init() gd.fat_pull() - if not self._checkout_has_systems(gd): - raise BranchRootHasNoSystemsError(root_url, base_ref) - def branch(self, args): '''Create a new system branch. @@ -258,9 +248,6 @@ class SimpleBranchAndMergePlugin(cliapp.Plugin): gd.fat_init() gd.fat_pull() - if not self._checkout_has_systems(gd): - raise BranchRootHasNoSystemsError(root_url, base_ref) - def _save_dirty_morphologies(self, loader, sb, morphs): logging.debug('Saving dirty morphologies: start') for morph in morphs: @@ -433,15 +420,6 @@ class SimpleBranchAndMergePlugin(cliapp.Plugin): msg="WARNING: %(message)s", message=str(e), error=True) - @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 - return False - def foreach(self, args): '''Run a command in each repository checked out in a system branch. -- cgit v1.2.1