summaryrefslogtreecommitdiff
path: root/morph
diff options
context:
space:
mode:
authorLars Wirzenius <lars.wirzenius@codethink.co.uk>2012-03-23 12:00:42 +0000
committerLars Wirzenius <lars.wirzenius@codethink.co.uk>2012-03-23 12:00:42 +0000
commit5aa1716e971a424dc1dbe6e4c69a36eb7c95e714 (patch)
treee8048c98b10e5d5cf7339d859691cf16f53c5725 /morph
parent2ff395757c6d0e5f48e0fbc57e90319e42197e8a (diff)
downloadmorph-5aa1716e971a424dc1dbe6e4c69a36eb7c95e714.tar.gz
Add "morph merge" subcommand
This is highly simplisitic, and it's going to be highly painful to use, but it does the very basics of what we need, I think.
Diffstat (limited to 'morph')
-rwxr-xr-xmorph17
1 files changed, 17 insertions, 0 deletions
diff --git a/morph b/morph
index 5b632a0e..5f278cb4 100755
--- a/morph
+++ b/morph
@@ -469,7 +469,24 @@ class Morph(cliapp.Application):
self._clone_to_directory(new_repo, repo, ref)
self.runcmd(['git', 'checkout', '-b', system_branch, ref],
cwd=new_repo)
+
+ def cmd_merge(self, args):
+ '''Merge specified repositories from another system branch.'''
+
+ if len(args) == 0:
+ raise cliapp.AppException('morph merge must get a branch name '
+ 'and some repo names as arguments')
+
+ other_branch = args[0]
+ mine = self._deduce_mine_directory()
+ this_branch = self._deduce_system_branch()
+ for repo in args[1:]:
+ basename = os.path.basename(repo)
+ pull_from = os.path.join(mine, other_branch, basename)
+ repo_dir = os.path.join(mine, this_branch, basename)
+ self.runcmd(['git', 'pull', pull_from], cwd=repo_dir)
+
def msg(self, msg):
'''Show a message to the user about what is going on.'''
logging.debug(msg)