##// END OF EJS Templates
update_revnum opens the file in binary mode (does not botch CRLF)
update_revnum opens the file in binary mode (does not botch CRLF)

File last commit:

r1052:eeb63d7b
r1052:eeb63d7b
Show More
update_revnum.py
14 lines | 355 B | text/x-python | PythonLexer
ville
initialization (no svn history)
r988 #!/usr/bin/env python
""" Change the revision number in Release.py """
import os
import re
Ville M. Vainio
tools/update_revnum: Change to bzr revision numbering.
r1051 rev = os.popen('bzr revno').read().strip()
ville
initialization (no svn history)
r988
print "current rev is",rev
assert ':' not in rev
Ville M. Vainio
update_revnum opens the file in binary mode (does not botch CRLF)
r1052 rfile = open('../IPython/Release.py','rb').read()
ville
initialization (no svn history)
r988 newcont = re.sub(r'revision\s*=.*', "revision = '%s'" % rev, rfile)
Ville M. Vainio
update_revnum opens the file in binary mode (does not botch CRLF)
r1052 open('../IPython/Release.py','wb').write(newcont)