summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 86a174a)
raw | patch | inline | side by side (parent: 86a174a)
author | richard <richard@57a73879-2fb5-44c3-a270-3262357dd7e2> | |
Fri, 23 Aug 2002 04:58:00 +0000 (04:58 +0000) | ||
committer | richard <richard@57a73879-2fb5-44c3-a270-3262357dd7e2> | |
Fri, 23 Aug 2002 04:58:00 +0000 (04:58 +0000) |
git-svn-id: http://svn.roundup-tracker.org/svnroot/roundup/trunk@991 57a73879-2fb5-44c3-a270-3262357dd7e2
roundup/backends/back_gadfly.py | patch | blob | history | |
test/test_db.py | patch | blob | history |
index 760b76c9e8ba6262ea27cf3e6825aab59f00ca99..5dc34db98dbd05035696df902fcb148a3742004b 100644 (file)
-# $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
============
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()
# do the delete
cursor = self.conn.cursor()
for classname in self.classes.keys():
- sql = 'delete from %s__journal where date<?'%classname
+ sql = "delete from %s__journal where date<? and "\
+ "action<>'create'"%classname
if __debug__:
print >>hyperdb.DEBUG, 'pack', (self, sql, date_stamp)
cursor.execute(sql, (date_stamp,))
#
# $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 c5cdb9a1b8bb47b7ed05e680b6af239ab82172e3..eabede4b6c74c8c093881e6cfc41222ebffbde44 100644 (file)
--- a/test/test_db.py
+++ b/test/test_db.py
# 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
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')
#
# $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)
#