summaryrefslogtreecommitdiff
path: root/morphlib/plugins/branch_and_merge_new_plugin.py
diff options
context:
space:
mode:
authorLars Wirzenius <lars.wirzenius@codethink.co.uk>2013-08-06 12:02:32 +0000
committerLars Wirzenius <lars.wirzenius@codethink.co.uk>2013-08-06 16:28:18 +0100
commit437ce27de0fec13d3efa939c04d17164049ccbfc (patch)
tree8c9727e7fef43d53e5d4ba7a535492fdb23e52a3 /morphlib/plugins/branch_and_merge_new_plugin.py
parent54f558d657131278baaecc02b60f9d05d88dc89d (diff)
downloadmorph-437ce27de0fec13d3efa939c04d17164049ccbfc.tar.gz
Re-implement "morph show-branch-root" using new infrastructure
Diffstat (limited to 'morphlib/plugins/branch_and_merge_new_plugin.py')
-rw-r--r--morphlib/plugins/branch_and_merge_new_plugin.py18
1 files changed, 18 insertions, 0 deletions
diff --git a/morphlib/plugins/branch_and_merge_new_plugin.py b/morphlib/plugins/branch_and_merge_new_plugin.py
index 40686aee..479bd2f9 100644
--- a/morphlib/plugins/branch_and_merge_new_plugin.py
+++ b/morphlib/plugins/branch_and_merge_new_plugin.py
@@ -33,6 +33,8 @@ class SimpleBranchAndMergePlugin(cliapp.Plugin):
'checkout', self.checkout, arg_synopsis='REPO BRANCH')
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
@@ -143,6 +145,22 @@ class SimpleBranchAndMergePlugin(cliapp.Plugin):
sb = morphlib.sysbranchdir.open_from_within('.')
self.app.output.write('%s\n' % sb.system_branch_name)
+ 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.
+
+ '''
+
+ ws = morphlib.workspace.open('.')
+ sb = morphlib.sysbranchdir.open_from_within('.')
+ self.app.output.write('%s\n' % sb.get_config('branch.root'))
+
def _remove_branch_dir_safe(self, workspace_root, system_branch_root):
# This function avoids throwing any exceptions, so it is safe to call
# inside an 'except' block without altering the backtrace.