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:
- 74:09b1f16aea24
- Parent:
- 73:f8ed8e727640
- Child:
- 75:081959a31b02
- Child:
- 76:8c6feef9d15a
--- a/neo.py Fri Apr 01 14:50:03 2016 +0100
+++ b/neo.py Wed Mar 30 20:52:49 2016 -0500
@@ -160,8 +160,10 @@
file = '^%s/' % file
exclude = '.hg/hgignore'
- with open(exclude, 'a') as f:
- f.write(file + '\n')
+ with open(exclude) as f:
+ if file not in f.read().splitlines():
+ with open(exclude, 'a') as f:
+ f.write(file + '\n')
def unignore(file):
file = '^%s/' % file
@@ -223,8 +225,10 @@
def ignore(file):
exclude = '.git/info/exclude'
- with open(exclude, 'a') as f:
- f.write(file + '\n')
+ with open(exclude) as f:
+ if file not in f.read().splitlines():
+ with open(exclude, 'a') as f:
+ f.write(file + '\n')
def unignore(file):
exclude = '.git/info/exclude'