Mercurial > p > roundup > code
changeset 566:73af3e54c309
We need to keep the last 'set' entry in the journal...
...to preserve information on 'activity' for nodes.
| author | Roche Compaan <rochecompaan@users.sourceforge.net> |
|---|---|
| date | Tue, 22 Jan 2002 05:06:09 +0000 |
| parents | 23e7ca59eb4b |
| children | 9ca63f7332a7 |
| files | roundup/backends/back_anydbm.py test/test_db.py |
| diffstat | 2 files changed, 21 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/roundup/backends/back_anydbm.py Tue Jan 22 00:21:32 2002 +0000 +++ b/roundup/backends/back_anydbm.py Tue Jan 22 05:06:09 2002 +0000 @@ -15,7 +15,7 @@ # BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE, # SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. # -#$Id: back_anydbm.py,v 1.24 2002-01-21 16:33:20 rochecompaan Exp $ +#$Id: back_anydbm.py,v 1.25 2002-01-22 05:06:08 rochecompaan Exp $ ''' This module defines a backend that saves the hyperdatabase in a database chosen by anydbm. It is guaranteed to always be available in python @@ -352,6 +352,15 @@ params) = entry if date_stamp > pack_before or action == 'create': l.append(entry) + elif action == 'set': + # grab the last set entry to keep information on + # activity + last_set_entry = entry + date_stamp = last_set_entry[1] + # if the last set entry was made after the pack date + # then it is already in the list + if date_stamp < pack_before: + l.append(last_set_entry) db[key] = marshal.dumps(l) if db_type == 'gdbm': db.reorganize() @@ -444,6 +453,9 @@ # #$Log: not supported by cvs2svn $ +#Revision 1.24 2002/01/21 16:33:20 rochecompaan +#You can now use the roundup-admin tool to pack the database +# #Revision 1.23 2002/01/18 04:32:04 richard #Rollback was breaking because a message hadn't actually been written to the file. Needs #more investigation.
--- a/test/test_db.py Tue Jan 22 00:21:32 2002 +0000 +++ b/test/test_db.py Tue Jan 22 05:06:09 2002 +0000 @@ -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.16 2002-01-21 16:33:20 rochecompaan Exp $ +# $Id: test_db.py,v 1.17 2002-01-22 05:06:09 rochecompaan Exp $ import unittest, os, shutil @@ -241,13 +241,16 @@ def testPack(self): self.db.issue.create(title="spam", status='1') + self.db.commit() self.db.issue.set('1', status='2') self.db.commit() + self.db.issue.set('1', status='3') + self.db.commit() pack_before = date.Date(". + 1d") self.db.pack(pack_before) journal = self.db.getjournal('issue', '1') - self.assertEqual(1, len(journal)) + self.assertEqual(2, len(journal)) def testRetire(self): pass @@ -344,6 +347,9 @@ # # $Log: not supported by cvs2svn $ +# Revision 1.16 2002/01/21 16:33:20 rochecompaan +# You can now use the roundup-admin tool to pack the database +# # Revision 1.15 2002/01/19 13:16:04 rochecompaan # Journal entries for link and multilink properties can now be switched on # or off.
