summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Maw <richard.maw@codethink.co.uk>2013-09-17 13:28:07 +0000
committerRichard Maw <richard.maw@codethink.co.uk>2013-09-17 14:36:39 +0000
commita27295adbbffed095854cc17e5ea52b8ebffab6a (patch)
tree9d0502bf5e61a15da332a515372a5223ce4e5f3f
parent3f5e504b947f5866e7922bf01347ef2c9ff5e7b6 (diff)
downloadmorph-a27295adbbffed095854cc17e5ea52b8ebffab6a.tar.gz
b&m: morph new-status provides per-branch status
-rw-r--r--morphlib/plugins/branch_and_merge_new_plugin.py24
1 files changed, 23 insertions, 1 deletions
diff --git a/morphlib/plugins/branch_and_merge_new_plugin.py b/morphlib/plugins/branch_and_merge_new_plugin.py
index bf24baba..ad1d4147 100644
--- a/morphlib/plugins/branch_and_merge_new_plugin.py
+++ b/morphlib/plugins/branch_and_merge_new_plugin.py
@@ -787,5 +787,27 @@ class SimpleBranchAndMergePlugin(cliapp.Plugin):
in each repository separately.
'''
- pass
+ branch = sb.get_config('branch.name')
+ root = sb.get_config('branch.root')
+
+ self.app.output.write("On branch %s, root %s\n" % (branch, root))
+ has_uncommitted_changes = False
+ for gd in sorted(sb.list_git_directories(), key=lambda x: x.dirname):
+ try:
+ repo = gd.get_config('morph.repository')
+ except cliapp.AppException:
+ self.app.output.write(
+ ' %s: not part of system branch\n' % gd.dirname)
+ # TODO: make this less vulnerable to a branch using
+ # refs/heads/foo instead of foo
+ head = gd.HEAD
+ if head != branch:
+ self.app.output.write(
+ ' %s: unexpected ref checked out %r\n' % (repo, head))
+ if any(gd.get_uncommitted_changes()):
+ has_uncommitted_changes = True
+ self.app.output.write(' %s: uncommitted changes\n' % repo)
+
+ if not has_uncommitted_changes:
+ self.app.output.write("\nNo repos have outstanding changes.\n")