From 2d222c33d1b6453bf117a0c8cc2f791fabe4e3a4 Mon Sep 17 00:00:00 2001 From: Mike O'Connor Date: Thu, 29 Oct 2009 22:47:15 +0000 Subject: [PATCH] removing known_changes now works, and inserting has a better chance of working Signed-off-by: Mike O'Connor --- dak/dakdb/update20.py | 1 + dak/process_new.py | 2 +- daklib/changes.py | 3 ++- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/dak/dakdb/update20.py b/dak/dakdb/update20.py index 6a44dd31..b35c84b3 100755 --- a/dak/dakdb/update20.py +++ b/dak/dakdb/update20.py @@ -137,6 +137,7 @@ def do_update(self): count += 1 print "Directory %s, file %7d, failures %3d. (%s)" % (dirpath[-10:], count, failure, changesfile) changes = Changes() + changes.changes_file = changesfile changesfile = os.path.join(dirpath, changesfile) changes.changes = parse_changes(changesfile, signing_rules=-1) changes.changes["fingerprint"], = check_signature(changesfile) diff --git a/dak/process_new.py b/dak/process_new.py index ad67dc5c..269971d0 100755 --- a/dak/process_new.py +++ b/dak/process_new.py @@ -704,6 +704,7 @@ def do_new(upload, session): elif answer == 'E' and not Options["Trainee"]: new = edit_overrides (new, upload, session) elif answer == 'M' and not Options["Trainee"]: + upload.pkg.remove_known_changes() aborted = upload.do_reject(manual=1, reject_message=Options["Manual-Reject"], note=get_new_comments(changes.get("source", ""), session=session)) @@ -800,7 +801,6 @@ def do_byhand(upload, session): Logger.log(["BYHAND REJECT: %s" % (upload.pkg.changes_file)]) upload.do_reject(manual=1, reject_message=Options["Manual-Reject"]) os.unlink(upload.pkg.changes_file[:-8]+".dak") - upload.pkg.remove_known_changes() done = 1 elif answer == 'S': done = 1 diff --git a/daklib/changes.py b/daklib/changes.py index 12cee457..2ecd9af4 100755 --- a/daklib/changes.py +++ b/daklib/changes.py @@ -183,11 +183,12 @@ class Changes(object): session = DBConn().session() privatetrans = True - session.query(KnownChange).filter(changesfile=self.changes_file).delete() + session.delete(get_knownchange(self.changes_file, session)) if privatetrans: session.commit() session.close() + def add_known_changes(self, queue, session=None): cnf = Config() -- 2.39.5