--- a/ForgeSCM/forgescm/lib/git.py
+++ b/ForgeSCM/forgescm/lib/git.py
@@ -61,9 +61,10 @@
def parse_header(self, cur_line, line_iter):
hash = cur_line.split()[-1].strip()
log.debug('Parsing changeset %s', hash)
- r = M.Commit.make(dict(repository_id=self.repo_id,
- hash=hash,
- summary=''))
+ r = M.Commit(
+ repository_id=self.repo_id,
+ hash=hash,
+ summary='')
while cur_line != '\n':
cur_line = line_iter.next()
if cur_line == '\n': break
@@ -78,10 +79,8 @@
elif cur_line == '\n':
if r.summary: break
else: cur_line = line_iter.next()
- r.m.save()
if self.result and not self.result[-1].parents:
self.result[-1].parents = [ r.hash ]
- self.result[-1].m.save()
self.result.append(r)
if cur_line == '\n':
cur_line = line_iter.next()
@@ -93,16 +92,15 @@
def parse_diff(self, cur_line, line_iter):
cmdline = cur_line.split(' ')
log.debug('Begin diff %s', cmdline)
- r = M.Patch.make(dict(repository_id=self.result[-1].repository_id,
- commit_id=self.result[-1]._id,
- filename=cmdline[2][2:]))
+ r = M.Patch(repository_id=self.result[-1].repository_id,
+ commit_id=self.result[-1]._id,
+ filename=cmdline[2][2:])
text_lines = []
while cur_line != '\n':
cur_line = line_iter.next()
if cur_line.startswith('diff'): break
if cur_line != '\n': text_lines.append(cur_line)
r.patch_text = bson.Binary(''.join(text_lines))
- r.m.save()
if cur_line == '\n':
cur_line = line_iter.next()
return cur_line