Morpheus / Mbed OS mbed-Client-Morpheus-hg

Dependencies:   mbed-os

Revision:
68:14cc5a81333d
Parent:
66:bfe0df4ef9f5
Child:
69:eb600c35d6ac
--- a/neo.py	Wed Mar 30 20:15:09 2016 -0500
+++ b/neo.py	Wed Mar 30 20:23:24 2016 -0500
@@ -126,6 +126,9 @@
         popen([hg_cmd, 'pull'])
         popen([hg_cmd, 'update'] + (['-r', hash] if hash else []))
 
+    def status():
+        popen([hg_cmd, 'status'])
+
     def hash():
         return pquery([hg_cmd, 'id', '-i']).strip().strip('+')
     def dirty():
@@ -194,6 +197,9 @@
         popen([git_cmd, 'fetch', 'origin'])
         popen([git_cmd, 'merge'] + ([hash] if hash else []))
 
+    def status():
+        popen([git_cmd, 'status', '-s'])
+
     def hash():
         return pquery([git_cmd, 'rev-parse', '--short', 'HEAD']).strip()
         
@@ -475,6 +481,7 @@
         + args,
         env=env)
 
+# Helpful status commands
 @subcommand('ls',
     help='list repositories recursively')
 def list_(prefix=''):
@@ -492,6 +499,18 @@
         with cd(lib.path):
             list_(nprefix)
 
+@subcommand('status',
+    help='show status of nested repositories')
+def status():
+    repo = Repo.fromrepo()
+    if repo.scm.dirty():
+        print '---', repo.name, '---'
+        repo.scm.status()
+
+    for lib in repo.libs:
+        with cd(lib.path):
+            status()
+
 # Parse/run command
 args, remainder = parser.parse_known_args()
 status = args.command(args)