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 ---------------------- yarns/branches-workspaces.yarn | 9 --------- 2 files changed, 31 deletions(-) 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. diff --git a/yarns/branches-workspaces.yarn b/yarns/branches-workspaces.yarn index c542994a..b6881fa6 100644 --- a/yarns/branches-workspaces.yarn +++ b/yarns/branches-workspaces.yarn @@ -58,15 +58,6 @@ Checking out a system branch should fail, if the branch doesn't exist. WHEN the user attempts to check out the system branch called foo THEN morph failed -Checking out a system branch should also fail if the repository does -not contain any system morphologies. - - SCENARIO checking out a system branch with no systems - GIVEN a workspace - AND a git server - WHEN the user attempts to check out from a repository with no systems - THEN morph failed - We can, instead, create a new system branch, off master. SCENARIO branch off master -- cgit v1.2.1