diff options
Diffstat (limited to 'morphlib/plugins/branch_and_merge_plugin.py')
-rw-r--r-- | morphlib/plugins/branch_and_merge_plugin.py | 107 |
1 files changed, 0 insertions, 107 deletions
diff --git a/morphlib/plugins/branch_and_merge_plugin.py b/morphlib/plugins/branch_and_merge_plugin.py index d39f815c..62a9f925 100644 --- a/morphlib/plugins/branch_and_merge_plugin.py +++ b/morphlib/plugins/branch_and_merge_plugin.py @@ -57,10 +57,6 @@ class BranchAndMergePlugin(cliapp.Plugin): def enable(self): # User-facing commands - self.app.add_subcommand('branch', self.branch, - arg_synopsis='REPO NEW [OLD]') - self.app.add_subcommand('checkout', self.checkout, - arg_synopsis='REPO BRANCH') self.app.add_subcommand('merge', self.merge, arg_synopsis='BRANCH') self.app.add_subcommand('edit', self.edit, @@ -86,12 +82,6 @@ class BranchAndMergePlugin(cliapp.Plugin): self.app.add_subcommand('foreach', self.foreach, arg_synopsis='-- COMMAND [ARGS...]') - # Plumbing commands (FIXME: should be hidden from --help by default) - self.app.add_subcommand('show-system-branch', self.show_system_branch, - arg_synopsis='') - self.app.add_subcommand('show-branch-root', self.show_branch_root, - arg_synopsis='') - def disable(self): pass @@ -583,81 +573,6 @@ class BranchAndMergePlugin(cliapp.Plugin): self.remove_branch_dir_safe(workspace, branch_name) raise - @warns_git_identity - def branch(self, args): - '''Create a new system branch. - - Command line arguments: - - * `REPO` is a repository URL. - * `NEW` is the name of the new system branch. - * `OLD` is the point from which to branch, and defaults to `master`. - - This creates a new system branch. It needs to be run in an - existing workspace (see `morph workspace`). It creates a new - git branch in the clone of the repository in the workspace. The - system branch will not be visible on the git server until you - push your changes to the repository. - - Example: - - cd /src/workspace - morph branch baserock:baserock:morphs jrandom/new-feature - - ''' - - if len(args) not in [2, 3]: - raise cliapp.AppException('morph branch needs name of branch ' - 'as parameter') - - repo = args[0] - new_branch = args[1] - commit = 'master' if len(args) == 2 else args[2] - - self.lrc, self.rrc = morphlib.util.new_repo_caches(self.app) - if self.get_cached_repo(repo).ref_exists(new_branch): - raise cliapp.AppException('branch %s already exists in ' - 'repository %s' % (new_branch, repo)) - - # Create the system branch directory. - workspace = self.deduce_workspace() - self._create_branch(workspace, new_branch, repo, commit) - - @warns_git_identity - def checkout(self, args): - '''Check out an existing system branch. - - Command line arguments: - - * `REPO` is the URL to the repository to the root repository of - a system branch. - * `BRANCH` is the name of the system branch. - - This will check out an existing system branch to an existing - workspace. You must create the workspace first. This only checks - out the root repository, not the repositories for individual - components. You need to use `morph edit` to check out those. - - Example: - - cd /src/workspace - morph checkout baserock:baserock/morphs master - - ''' - - if len(args) != 2: - raise cliapp.AppException('morph checkout needs a repo and the ' - 'name of a branch as parameters') - - repo = args[0] - system_branch = args[1] - - self.lrc, self.rrc = morphlib.util.new_repo_caches(self.app) - - # Create the system branch directory. - workspace = self.deduce_workspace() - self._create_branch(workspace, system_branch, repo, system_branch) - def checkout_repository(self, branch_dir, repo, ref, parent_ref=None): '''Make a chunk or stratum repository available for a system branch @@ -1997,25 +1912,3 @@ class BranchAndMergePlugin(cliapp.Plugin): raise cliapp.AppException( 'Command failed at repo %s: %s' % (repo, ' '.join(args))) - def show_system_branch(self, args): - '''Show the name of the current system branch.''' - - branch, dirname = self.deduce_system_branch() - self.app.output.write('%s\n' % branch) - - def show_branch_root(self, args): - '''Show the name of the repository holding the system morphologies. - - This would, for example, write out something like: - - /src/ws/master/baserock:baserock/morphs - - when the master branch of the `baserock:baserock/morphs` - repository is checked out. - - ''' - - workspace = self.deduce_workspace() - system_branch, branch_dir = self.deduce_system_branch() - branch_root = self.get_branch_config(branch_dir, 'branch.root') - self.app.output.write('%s\n' % branch_root) |