##// 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
#!/usr/bin/env python
""" Change the revision number in Release.py """
import os
import re
rev = os.popen('bzr revno').read().strip()
print "current rev is",rev
assert ':' not in rev
rfile = open('../IPython/Release.py','rb').read()
newcont = re.sub(r'revision\s*=.*', "revision = '%s'" % rev, rfile)
open('../IPython/Release.py','wb').write(newcont)