]> git.decadent.org.uk Git - dak.git/commitdiff
removing known_changes now works, and inserting has a better chance of working
authorMike O'Connor <stew@dhcp-101.dfw1.kickstart.lan>
Thu, 29 Oct 2009 22:47:15 +0000 (22:47 +0000)
committerMike O'Connor <stew@dhcp-101.dfw1.kickstart.lan>
Thu, 29 Oct 2009 22:47:15 +0000 (22:47 +0000)
Signed-off-by: Mike O'Connor <stew@dhcp-101.dfw1.kickstart.lan>
dak/dakdb/update20.py
dak/process_new.py
daklib/changes.py

index 6a44dd316bc9948a35a3e38f18401abd5f876885..b35c84b3851cf5a1674dcbb45f649f3a2fcfa124 100755 (executable)
@@ -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)
index ad67dc5c43970ca3dfa94d9e960528ad8c2e35fd..269971d0242ce83e5859dc5c14b723cf1f2f435a 100755 (executable)
@@ -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
index 12cee457c5f7976d16ac999eb3d57d629dd339b0..2ecd9af421752d4630c57806abe7ac3803bcb86c 100755 (executable)
@@ -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()