~abentley/bzrtools/bzrtools.dev

« back to all changes in this revision

Viewing changes to check-release.py

  • Committer: Aaron Bentley
  • Date: 2006-07-13 13:25:20 UTC
  • Revision ID: abentley@panoramicfeedback.com-20060713132520-2fabfab51affb82f
Update clean-tree docs

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)