Morpheus / Mbed OS mbed-Client-Morpheus-hg

Dependencies:   mbed-os

Revision:
61:5c3f41de9d97
Parent:
54:3cb9f99bbaaa
Child:
62:d6a6204fb327
diff -r 3cb9f99bbaaa -r 5c3f41de9d97 neo.py
--- a/neo.py	Wed Mar 30 18:10:58 2016 -0500
+++ b/neo.py	Wed Mar 30 19:45:15 2016 -0500
@@ -438,6 +438,23 @@
         + args,
         env=env)
 
+@subcommand('list',
+    help='list repositories recursively')
+def list_(prefix=''):
+    repo = Repo.fromrepo()
+    print prefix + repo.name, '(%s)' % repo.hash
+
+    for i, lib in enumerate(repo.libs):
+        if prefix:
+            nprefix = prefix[:-3] + ('|  ' if prefix[-3] == '|' else '   ')
+        else:
+            nprefix = ''
+
+        nprefix += '|- ' if i < len(repo.libs)-1 else '`- '
+
+        with cd(lib.path):
+            list_(nprefix)
+
 # Parse/run command
 args, remainder = parser.parse_known_args()
 status = args.command(args)