summaryrefslogtreecommitdiff
path: root/morphlib/plugins/branch_and_merge_new_plugin.py
diff options
context:
space:
mode:
authorLars Wirzenius <lars.wirzenius@codethink.co.uk>2013-07-31 12:03:40 +0000
committerLars Wirzenius <lars.wirzenius@codethink.co.uk>2013-07-31 16:05:19 +0000
commit0f77afae8b89d3ef57053562d37364c118d9e519 (patch)
tree3c4aabf4b992d22afd4c8d521a403409d716b435 /morphlib/plugins/branch_and_merge_new_plugin.py
parent339c05186f49d0203618b5979cf4e76d6d1fc3e6 (diff)
downloadmorph-0f77afae8b89d3ef57053562d37364c118d9e519.tar.gz
Re-implement "morph workspace" using the Workspace class
Put new implementation into new branch and merge plugin, and remove old implementation from the old plugin. Also change the error message for the NotInWorkspace exception, so that it matches what the test suite expects. It's a crappy error message, I think, but I don't want to change external behaviour during refactoring.
Diffstat (limited to 'morphlib/plugins/branch_and_merge_new_plugin.py')
-rw-r--r--morphlib/plugins/branch_and_merge_new_plugin.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/morphlib/plugins/branch_and_merge_new_plugin.py b/morphlib/plugins/branch_and_merge_new_plugin.py
index 2c92156f..fb3be920 100644
--- a/morphlib/plugins/branch_and_merge_new_plugin.py
+++ b/morphlib/plugins/branch_and_merge_new_plugin.py
@@ -25,6 +25,7 @@ class SimpleBranchAndMergePlugin(cliapp.Plugin):
def enable(self):
self.app.add_subcommand('init', self.init, arg_synopsis='[DIR]')
+ self.app.add_subcommand('workspace', self.workspace, arg_synopsis='')
def disable(self):
pass
@@ -61,3 +62,9 @@ class SimpleBranchAndMergePlugin(cliapp.Plugin):
ws = morphlib.workspace.create(args[0])
self.app.status(msg='Initialized morph workspace', chatty=True)
+ def workspace(self, args):
+ '''Show the toplevel directory of the current workspace.'''
+
+ ws = morphlib.workspace.open('.')
+ self.app.output.write('%s\n' % ws.root)
+