| 1 | #! /usr/bin/env python
|
|---|
| 2 |
|
|---|
| 3 | """Turn a pile of RCS log output into ChangeLog file entries.
|
|---|
| 4 |
|
|---|
| 5 | """
|
|---|
| 6 |
|
|---|
| 7 | import sys
|
|---|
| 8 | import string
|
|---|
| 9 | import re
|
|---|
| 10 | import getopt
|
|---|
| 11 | import time
|
|---|
| 12 |
|
|---|
| 13 | def main():
|
|---|
| 14 | args = sys.argv[1:]
|
|---|
| 15 | opts, args = getopt.getopt(args, 'p:')
|
|---|
| 16 | prefix = ''
|
|---|
| 17 | for o, a in opts:
|
|---|
| 18 | if p == '-p': prefix = a
|
|---|
| 19 |
|
|---|
| 20 | f = sys.stdin
|
|---|
| 21 | allrevs = []
|
|---|
| 22 | while 1:
|
|---|
| 23 | file = getnextfile(f)
|
|---|
| 24 | if not file: break
|
|---|
| 25 | revs = []
|
|---|
| 26 | while 1:
|
|---|
| 27 | rev = getnextrev(f, file)
|
|---|
| 28 | if not rev:
|
|---|
| 29 | break
|
|---|
| 30 | revs.append(rev)
|
|---|
| 31 | if revs:
|
|---|
| 32 | allrevs[len(allrevs):] = revs
|
|---|
| 33 | allrevs.sort()
|
|---|
| 34 | allrevs.reverse()
|
|---|
| 35 | for rev in allrevs:
|
|---|
| 36 | formatrev(rev, prefix)
|
|---|
| 37 |
|
|---|
| 38 | parsedateprog = re.compile(
|
|---|
| 39 | '^date: ([0-9]+)/([0-9]+)/([0-9]+) ' +
|
|---|
| 40 | '([0-9]+):([0-9]+):([0-9]+); author: ([^ ;]+)')
|
|---|
| 41 |
|
|---|
| 42 | authormap = {
|
|---|
| 43 | 'guido': 'Guido van Rossum <[email protected]>',
|
|---|
| 44 | 'jack': 'Jack Jansen <[email protected]>',
|
|---|
| 45 | 'sjoerd': 'Sjoerd Mullender <[email protected]>',
|
|---|
| 46 | }
|
|---|
| 47 |
|
|---|
| 48 | def formatrev(rev, prefix):
|
|---|
| 49 | dateline, file, revline, log = rev
|
|---|
| 50 | if parsedateprog.match(dateline) >= 0:
|
|---|
|
|---|