-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbzr_parser.py
More file actions
41 lines (40 loc) · 1.18 KB
/
bzr_parser.py
File metadata and controls
41 lines (40 loc) · 1.18 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
from base_parser import BaseParser
class BazaarParser(BaseParser):
"""for Bazaar
"""
def parse(self, cmtlog):
with open(cmtlog) as f:
revno = ''
message = ''
for line in f:
line = line.strip()
if line.startswith('------------------------------------------------------------'):
#Handle the old ones
if len(revno) > 0:
cmt = {}
cmt['commitno'] = revno
cmt['message'] = message
self.cmts.append(cmt)
#Reset
revno = ''
message = ''
elif line.startswith('revno:'):
revno = line.replace('revno:', '').strip()
elif line.startswith('committer:'):
pass
elif line.startswith('author:'):
pass
elif line.startswith('From:'):
pass
elif line.startswith('branch'):
pass
elif line.startswith('timestamp:'):
pass
elif line.startswith('date:'):
pass
elif line.startswith('message:'):
message = line.replace('message:', '').strip()
else:
#if line.find(': ') != -1:
# print line
message += ' ' + line