diff options
author | Sam Thursfield <sam.thursfield@codethink.co.uk> | 2012-09-05 13:36:48 +0100 |
---|---|---|
committer | Jannis Pohlmann <jannis.pohlmann@codethink.co.uk> | 2012-09-10 10:59:39 +0000 |
commit | fb2e08f81d96741c05597208fdab196ec0c1b584 (patch) | |
tree | 634e55c5adc1bbdf793f2fd074780da660b5cff7 /morphlib | |
parent | c92ab20b116dab473b48d09a19563aba11d29288 (diff) | |
download | morph-fb2e08f81d96741c05597208fdab196ec0c1b584.tar.gz |
Reorder functions
'morph edit' and 'morph merge' are closely related (merge mostly
undoes the things edit did to morphologies), so move them together
Diffstat (limited to 'morphlib')
-rw-r--r-- | morphlib/plugins/branch_and_merge_plugin.py | 38 |
1 files changed, 19 insertions, 19 deletions
diff --git a/morphlib/plugins/branch_and_merge_plugin.py b/morphlib/plugins/branch_and_merge_plugin.py index 4f8e940b..d44ccacc 100644 --- a/morphlib/plugins/branch_and_merge_plugin.py +++ b/morphlib/plugins/branch_and_merge_plugin.py @@ -434,25 +434,6 @@ class BranchAndMergePlugin(cliapp.Plugin): branch_root = self.get_branch_config(branch_dir, 'branch.root') self.app.output.write('%s\n' % branch_root) - def merge(self, args): - '''Merge specified repositories from another system branch.''' - - if len(args) < 2: - raise cliapp.AppException('morph merge must get a branch name ' - 'and some repo names as arguments') - - workspace = self.deduce_workspace() - other_branch, other_branch_dir = \ - args[0], self.find_system_branch(workspace, args[0]) - this_branch, this_branch_dir = self.deduce_system_branch() - - for repo in args[1:]: - pull_dir = self.find_repository(other_branch_dir, repo) - pull_url = urlparse.urljoin('file://', pull_dir) - repo_dir = self.find_repository(this_branch_dir, repo) - self.app.runcmd(['git', 'pull', pull_url, other_branch], - cwd=repo_dir) - def make_repository_available(self, system_branch, branch_dir, repo, ref): existing_repo = self.find_repository(branch_dir, repo) if existing_repo: @@ -555,6 +536,25 @@ class BranchAndMergePlugin(cliapp.Plugin): self.print_changelog('The following changes were made but have not ' 'been comitted') + def merge(self, args): + '''Merge specified repositories from another system branch.''' + + if len(args) < 2: + raise cliapp.AppException('morph merge must get a branch name ' + 'and some repo names as arguments') + + workspace = self.deduce_workspace() + other_branch, other_branch_dir = \ + args[0], self.find_system_branch(workspace, args[0]) + this_branch, this_branch_dir = self.deduce_system_branch() + + for repo in args[1:]: + pull_dir = self.find_repository(other_branch_dir, repo) + pull_url = urlparse.urljoin('file://', pull_dir) + repo_dir = self.find_repository(this_branch_dir, repo) + self.app.runcmd(['git', 'pull', pull_url, other_branch], + cwd=repo_dir) + def build(self, args): if len(args) != 1: raise cliapp.AppException('morph build expects exactly one ' |