svn and python
filed in Tips on Oct.03, 2008
I still use svn for some projects, some of them are python.
Python pre-compiles the python files, so, the first time i run one of this projects i end up with a bunch of .pyc files that i don’t want to add to the repository.
Since svn doesn’t know this files the svn status
generates a lot of garbage in the output.
svn has a property ( see svn properties ) called svn:ignore that tells svn to ignore certain files matching a pattern. The problem is that this property is directory/file based so you have to set it, at least, to every directory.
easy way to do this:
$ cd myproject
$ find . -type d | grep -v '.svn' | xargs svn propset svn:ignore "*.pyc"
$ svn commit
Leave a Reply