From: richard Date: Fri, 23 Aug 2002 04:58:00 +0000 (+0000) Subject: ahhh, I understand now X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=39f4554de290e28caa606a44a736eb6b0fc389bc;p=roundup.git ahhh, I understand now git-svn-id: http://svn.roundup-tracker.org/svnroot/roundup/trunk@991 57a73879-2fb5-44c3-a270-3262357dd7e2 --- diff --git a/roundup/backends/back_gadfly.py b/roundup/backends/back_gadfly.py index 760b76c..5dc34db 100644 --- a/roundup/backends/back_gadfly.py +++ b/roundup/backends/back_gadfly.py @@ -1,4 +1,4 @@ -# $Id: back_gadfly.py,v 1.2 2002-08-23 04:48:10 richard Exp $ +# $Id: back_gadfly.py,v 1.3 2002-08-23 04:58:00 richard Exp $ __doc__ = ''' About Gadfly ============ @@ -710,8 +710,7 @@ class Database(FileStorage, hyperdb.Database, roundupdb.Database): return res def pack(self, pack_before): - ''' Pack the database, removing all journal entries before the - "pack_before" date. + ''' Delete all journal entries except "create" before 'pack_before'. ''' # get a 'yyyymmddhhmmss' version of the date date_stamp = pack_before.serialise() @@ -719,7 +718,8 @@ class Database(FileStorage, hyperdb.Database, roundupdb.Database): # do the delete cursor = self.conn.cursor() for classname in self.classes.keys(): - sql = 'delete from %s__journal where date'create'"%classname if __debug__: print >>hyperdb.DEBUG, 'pack', (self, sql, date_stamp) cursor.execute(sql, (date_stamp,)) @@ -1645,6 +1645,20 @@ class IssueClass(Class, roundupdb.IssueClass): # # $Log: not supported by cvs2svn $ +# Revision 1.2 2002/08/23 04:48:10 richard +# That's gadfly done, mostly. Things left: +# - Class.filter (I'm a wuss ;) +# - schema changes adding new non-multilink properties are not implemented. +# gadfly doesn't have an ALTER TABLE command, making that quite difficult :) +# +# I had to mangle two unit tests to get this all working: +# - gadfly also can't handle two handles open on the one database, so +# testIDGeneration doesn't try that. +# - testNewProperty is disabled as per the second comment above. +# +# I noticed test_pack was incorrect, and the *dbm tests fail there now. +# Looking into it... +# # Revision 1.1 2002/08/22 07:56:51 richard # Whee! It's not finished yet, but I can create a new instance and play with # it a little bit :) diff --git a/test/test_db.py b/test/test_db.py index c5cdb9a..eabede4 100644 --- a/test/test_db.py +++ b/test/test_db.py @@ -15,7 +15,7 @@ # BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE, # SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. # -# $Id: test_db.py,v 1.40 2002-08-23 04:48:36 richard Exp $ +# $Id: test_db.py,v 1.41 2002-08-23 04:58:00 richard Exp $ import unittest, os, shutil, time @@ -413,8 +413,8 @@ class anydbmDBTestCase(MyTestCase): self.db.pack(pack_before) journal = self.db.getjournal('issue', '1') - # we should have one entry now - self.assertEqual(1, len(journal)) + # we should have the create and last set entries now + self.assertEqual(2, len(journal)) def testIDGeneration(self): id1 = self.db.issue.create(title="spam", status='1') @@ -668,6 +668,9 @@ def suite(): # # $Log: not supported by cvs2svn $ +# Revision 1.40 2002/08/23 04:48:36 richard +# oops, forgot +# # Revision 1.39 2002/07/31 23:57:37 richard # . web forms may now unset Link values (like assignedto) #