Add experimental import into DB

This commit is contained in:
Stephan Kulow
2022-10-17 20:39:03 +02:00
parent a82562b794
commit 8563334b07
4 changed files with 42 additions and 3 deletions

View File

@@ -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.