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:
- 73:f8ed8e727640
- Parent:
- 71:ddc08f2d5697
- Parent:
- 72:08d69d476038
- Child:
- 74:09b1f16aea24
--- a/neo.py Fri Apr 01 14:47:25 2016 +0100
+++ b/neo.py Fri Apr 01 14:50:03 2016 +0100
@@ -58,6 +58,7 @@
return command
return subcommand
+
# Process execution
class ProcessException(Exception):
pass
@@ -89,6 +90,9 @@
finally:
os.chdir(prevdir)
+def relpath(root, path):
+ return path[len(root)+1:]
+
# Handling for multiple version controls
scms = OrderedDict()
def scm(name):
@@ -348,7 +352,7 @@
with cd(repo.path):
for lib in repo.libs:
import_(lib.url, lib.path)
- repo.scm.ignore(lib.path[len(repo.path)+1:])
+ repo.scm.ignore(relpath(repo.path, lib.path))
if (not os.path.isfile('mbed_settings.py') and
os.path.isfile('mbed-os/tools/settings.py')):
@@ -361,7 +365,7 @@
repo = Repo.fromrepo()
for lib in repo.libs:
import_(lib.url, lib.path)
- repo.scm.ignore(lib.path[len(repo.path)+1:])
+ repo.scm.ignore(relpath(repo.path, lib.path))
# Install/uninstall command
@subcommand('add', 'url', 'name?',
@@ -371,7 +375,7 @@
lib = Repo.fromurl(url, path)
import_(lib.url, lib.path)
- repo.scm.ignore(lib.path[len(repo.path)+1:])
+ repo.scm.ignore(relpath(repo.path, lib.path))
lib.synch()
lib.write()
@@ -385,7 +389,7 @@
repo.scm.remove(lib.lib)
shutil.rmtree(lib.path)
- repo.scm.unignore(lib.path[len(repo.path)+1:])
+ repo.scm.unignore(relpath(repo.path, lib.path))
# Publish command
@subcommand('publish',
@@ -428,7 +432,7 @@
% (lib.name, lib.path), 1)
shutil.rmtree(lib.path)
- repo.scm.unignore(lib.path[len(repo.path)+1:])
+ repo.scm.unignore(relpath(repo.path, lib.path))
repo.synch()
@@ -438,7 +442,7 @@
update(lib.hash)
else:
import_(lib.url, lib.path)
- repo.scm.ignore(lib.path[len(repo.path)+1:])
+ repo.scm.ignore(relpath(repo.path, lib.path))
# Synch command
@subcommand('synch',