~abentley/bzrtools/bzrtools.dev

« back to all changes in this revision

Viewing changes to check-release.py

  • Committer: Aaron Bentley
  • Date: 2006-06-14 18:09:53 UTC
  • mto: This revision was merged to the branch mainline in revision 395.
  • Revision ID: abentley@panoramicfeedback.com-20060614180953-4671478534fd8823
Update NEWS

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#!/usr/bin/env python
2
 
import os
3
 
import re
4
 
from subprocess import call, PIPE
5
 
import sys
6
 
 
7
 
sys.path.insert(0, '/home/abentley/bzrplugins')
8
 
sys.path.insert(0, os.path.dirname(os.path.realpath('/home/abentley/bin/bzr')))
9
 
import bzrtools
10
 
print "bzrtools version: %s" % bzrtools.__version__
11
 
def minigrep(pattern, filename):
12
 
    setup = open(filename, 'rb')
13
 
    for line in setup:
14
 
        match = re.search(pattern, line)
15
 
        if match is not None:
16
 
            return match
17
 
 
18
 
newsmatch = minigrep('RELEASE: bzrtools %s' % (bzrtools.__version__), 'NEWS')
19
 
if newsmatch is None:
20
 
    print "NEWS entry missing"
21
 
    sys.exit(1)
22
 
else:
23
 
    print "NEWS entry found"
24
 
if call(['bzr', 'diff'], stdout=PIPE) != 0:
25
 
    print "Please commit before releasing"
26
 
    sys.exit(1)