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:
- 40:2446665dfdf8
- Parent:
- 39:8d6f31570710
- Child:
- 41:59e9d808ee05
--- a/neo.py Wed Mar 30 15:15:10 2016 -0500 +++ b/neo.py Wed Mar 30 15:31:17 2016 -0500 @@ -125,7 +125,11 @@ def hash(): return pquery(['git', 'rev-parse', '--short', 'HEAD']).strip() def dirty(): return pquery(['git', 'diff', '--name-only', 'HEAD']) - + + def ignore(regex): + with open('.git/info/exclude', 'a') as f: + f.write(regex) + # Repository object class Repo(object): @@ -232,6 +236,7 @@ with cd(repo.path): for lib in repo.libs: import_(lib.url, lib.path) + #repo.scm.ignore(lib.path) if (not os.path.isfile('mbed_settings.py') and os.path.isfile('mbed-os/tools/settings.py')): @@ -257,6 +262,7 @@ lib.write() repo.scm.add(lib.lib) + #repo.scm.ignore(lib.path) @subcommand('remove', 'path', help='remove a library from the current repository folder') @@ -330,12 +336,12 @@ @subcommand('compile', 'args*', help='compile project using workspace_tools') def compile(args): - repo = Repo.fromrepo() - if not os.path.isdir('mbed-os'): sys.stderr.write('Warning! mbed-os not found?\n') sys.exit(-1) + repo = Repo.fromrepo() + macros = [] if os.path.isfile('MACROS.txt'): with open('MACROS.txt') as f: @@ -354,12 +360,12 @@ @subcommand('export', 'args*', help='generate project files') def export(args): - repo = Repo.fromrepo() - if not os.path.isdir('mbed-os'): sys.stderr.write('Warning! mbed-os not found?\n') sys.exit(-1) + repo = Repo.fromrepo() + env = os.environ.copy() env['PYTHONPATH'] = '.' popen(['python', 'mbed-os/tools/project.py',