forked from adamm/git-importer
2784171f75
This is a rather complex operation, but whenever a package changes in Factory, the inherited package gets a shadow revision consisting of the 3-way merge. If this happens due to a request being accepted, this is actually in most cases also commited by 'buildservice-autocommit', so we're making sure this is always happening (and are actually duplicating revisions in cases that we filter out later as empty commits). To differenciate the fake revisions from the real revisions, I add a fraction part
25 lines
566 B
Python
25 lines
566 B
Python
import sys
|
|
|
|
import yaml
|
|
|
|
from lib.db import DB
|
|
from lib.db_revision import DBRevision
|
|
|
|
|
|
class Exporter:
|
|
def __init__(self, package):
|
|
self.package = package
|
|
|
|
def run(self):
|
|
db = DB()
|
|
cur = db.cursor()
|
|
cur.execute(
|
|
"SELECT * from revisions where package=%s ORDER BY project,rev",
|
|
(self.package,),
|
|
)
|
|
data = {"revisions": []}
|
|
for row in cur.fetchall():
|
|
data["revisions"].append(DBRevision(row).as_dict(db))
|
|
|
|
yaml.dump(data, sys.stdout, default_flow_style=False)
|