]> git.decadent.org.uk Git - dak.git/commitdiff
process-new
authorJoerg Jaspert <joerg@debian.org>
Sun, 5 Jul 2009 13:49:35 +0000 (15:49 +0200)
committerJoerg Jaspert <joerg@debian.org>
Sun, 5 Jul 2009 13:49:35 +0000 (15:49 +0200)
allow to delete all notes at once, including notes for old versions.

Signed-off-by: Joerg Jaspert <joerg@debian.org>
dak/process_new.py
daklib/database.py

index a7da65c3c874434228fbd4588bb816009a6d41ad..a07470faaaa1f34a1457b5c35c930f61cdbb428b 100755 (executable)
@@ -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':
index 3d69cf19d07f9d3b7fb415bbfcf28fb5b43fb1b6..826e0441954ce8515968e07ee010e15900be840f 100755 (executable)
@@ -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):
     """