forked from adamm/git-importer
Add experimental import into DB
This commit is contained in:
@@ -2,6 +2,7 @@ import functools
|
||||
import logging
|
||||
|
||||
from lib.binary import is_binary_or_large
|
||||
from lib.db import DB
|
||||
from lib.git import Git
|
||||
from lib.history import History
|
||||
from lib.obs import OBS
|
||||
@@ -120,6 +121,14 @@ class Importer:
|
||||
print(f"Remove {name}")
|
||||
self.git.remove(name)
|
||||
|
||||
def import_into_db(self):
|
||||
db = DB()
|
||||
self.history.fetch_all_revisions(self.projects)
|
||||
for project, _, _ in self.projects:
|
||||
for rev in self.history[project]:
|
||||
db.import_rev(rev)
|
||||
db.conn.commit()
|
||||
|
||||
def import_all_revisions(self, gc):
|
||||
# Fetch all the requests and sort them. Ideally we should
|
||||
# build the graph here, to avoid new commits before the merge.
|
||||
|
Reference in New Issue
Block a user