diff options
Diffstat (limited to 'morphlib/plugins/branch_and_merge_new_plugin.py')
-rw-r--r-- | morphlib/plugins/branch_and_merge_new_plugin.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/morphlib/plugins/branch_and_merge_new_plugin.py b/morphlib/plugins/branch_and_merge_new_plugin.py index 353f0bcc..40686aee 100644 --- a/morphlib/plugins/branch_and_merge_new_plugin.py +++ b/morphlib/plugins/branch_and_merge_new_plugin.py @@ -31,6 +31,8 @@ class SimpleBranchAndMergePlugin(cliapp.Plugin): self.app.add_subcommand('workspace', self.workspace, arg_synopsis='') self.app.add_subcommand( 'checkout', self.checkout, arg_synopsis='REPO BRANCH') + self.app.add_subcommand( + 'show-system-branch', self.show_system_branch, arg_synopsis='') def disable(self): pass @@ -134,6 +136,13 @@ class SimpleBranchAndMergePlugin(cliapp.Plugin): self._remove_branch_dir_safe(ws.root, root_dir) raise + def show_system_branch(self, args): + '''Show the name of the current system branch.''' + + ws = morphlib.workspace.open('.') + sb = morphlib.sysbranchdir.open_from_within('.') + self.app.output.write('%s\n' % sb.system_branch_name) + 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. |