From: Joerg Jaspert Date: Sun, 5 Jul 2009 13:49:35 +0000 (+0200) Subject: process-new X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=01ee51191df7ebb38160b7942530a09ec14ad538;p=dak process-new allow to delete all notes at once, including notes for old versions. Signed-off-by: Joerg Jaspert --- diff --git a/dak/process_new.py b/dak/process_new.py index a7da65c3..a07470fa 100755 --- a/dak/process_new.py +++ b/dak/process_new.py @@ -676,7 +676,7 @@ def do_new(): print "W: [!] marked entries must be fixed before package can be processed." if note: print "W: note must be removed before package can be processed." - prompt += "Remove note, " + prompt += "RemOve all notes, Remove note, " prompt += "Edit overrides, Check, Manual reject, Note edit, Prod, [S]kip, Quit ?" @@ -713,6 +713,10 @@ def do_new(): confirm = utils.our_raw_input("Really clear note (y/N)? ").lower() if confirm == "y": database.delete_new_comments(changes.get("source"), changes.get("version")) + elif answer == 'O' and not Options["Trainee"]: + confirm = utils.our_raw_input("Really clear all notes (y/N)? ").lower() + if confirm == "y": + database.delete_all_new_comments(changes.get("source")) elif answer == 'S': done = 1 elif answer == 'Q': diff --git a/daklib/database.py b/daklib/database.py index 3d69cf19..826e0441 100755 --- a/daklib/database.py +++ b/daklib/database.py @@ -934,6 +934,16 @@ def delete_new_comments(package, version): """ % (package, version)) return +def delete_all_new_comments(package): + """ + Delete all comments for C{package}, if they exist + """ + + projectB.query(""" DELETE FROM new_comments + WHERE package = '%s' + """ % (package)) + return + ################################################################################ def copy_temporary_contents(package, version, arch, deb, reject): """