Skip to content

Commit b53d640

Browse files
author
Richard Jones
committed
use more robust date stamp comparisons in pack(), make journal smaller too
1 parent 6733075 commit b53d640

File tree

1 file changed

+13
-5
lines changed

1 file changed

+13
-5
lines changed

roundup/backends/back_anydbm.py

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
# BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE,
1616
# SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
1717
#
18-
#$Id: back_anydbm.py,v 1.62 2002-08-21 07:07:27 richard Exp $
18+
#$Id: back_anydbm.py,v 1.63 2002-08-22 04:42:28 richard Exp $
1919
'''
2020
This module defines a backend that saves the hyperdatabase in a database
2121
chosen by anydbm. It is guaranteed to always be available in python
@@ -495,8 +495,6 @@ def pack(self, pack_before):
495495
if __debug__:
496496
print >>hyperdb.DEBUG, 'packjournal', (self, pack_before)
497497

498-
pack_before = pack_before.get_tuple()
499-
500498
classes = self.getclasses()
501499

502500
# figure the class db type
@@ -514,6 +512,7 @@ def pack(self, pack_before):
514512
for entry in journal:
515513
(nodeid, date_stamp, self.journaltag, action,
516514
params) = entry
515+
date_stamp = date.Date(date_stamp)
517516
if date_stamp > pack_before or action == 'create':
518517
l.append(entry)
519518
elif action == 'set':
@@ -1172,9 +1171,9 @@ class or a KeyError is raised.
11721171
# figure the journal entry
11731172
l = []
11741173
if add:
1175-
l.append(('add', add))
1174+
l.append(('+', add))
11761175
if remove:
1177-
l.append(('remove', remove))
1176+
l.append(('-', remove))
11781177
if l:
11791178
journalvalues[propname] = tuple(l)
11801179

@@ -1912,6 +1911,15 @@ def __init__(self, db, classname, **properties):
19121911

19131912
#
19141913
#$Log: not supported by cvs2svn $
1914+
#Revision 1.62 2002/08/21 07:07:27 richard
1915+
#In preparing to turn back on link/unlink journal events (by default these
1916+
#are turned off) I've:
1917+
#- fixed back_anydbm so it can journal those events again (had broken it
1918+
# with recent changes)
1919+
#- changed the serialisation format for dates and intervals to use a
1920+
# numbers-only (and sign for Intervals) string instead of tuple-of-ints.
1921+
# Much smaller.
1922+
#
19151923
#Revision 1.61 2002/08/19 02:53:27 richard
19161924
#full database export and import is done
19171925
#

0 commit comments

Comments
 (0)