Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: mbed-os
Diff: neo.py
- Revision:
- 39:8d6f31570710
- Parent:
- 38:0ca5eea23af9
- Child:
- 40:2446665dfdf8
--- a/neo.py Wed Mar 30 13:58:36 2016 -0500 +++ b/neo.py Wed Mar 30 15:15:10 2016 -0500 @@ -111,11 +111,17 @@ def clone(url, name=None, hash=None): popen(['git', 'clone', url, name]) if hash: - popen(['git', 'checkout', hash]) + with cd(name): + popen(['git', 'checkout', '-q', hash]) def add(file): popen(['git', 'add', file]) def remove(file): popen(['git', 'rm', '-f', file]) + def commit(): popen(['git', 'commit', '-a']) + def push(): popen(['git', 'push', '--all']) + def pull(hash=None): + popen(['git', 'fetch', 'origin']) + popen(['git', 'merge'] + ([hash] if hash else [])) def hash(): return pquery(['git', 'rev-parse', '--short', 'HEAD']).strip() def dirty(): return pquery(['git', 'diff', '--name-only', 'HEAD']) @@ -162,12 +168,18 @@ def synch(self): if os.path.isdir(self.path): - self.scm = self.getscm() - self.hash = self.gethash() - self.libs = list(self.getlibs()) + try: + self.scm = self.getscm() + self.hash = self.gethash() + self.libs = list(self.getlibs()) + except ProcessException: + pass if os.path.isfile(self.lib): - self.repo = self.getrepo() + try: + self.repo = self.getrepo() + except ProcessException: + pass def getscm(self): for name, scm in scms.items():