Commit d85478ac authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent 1b6108ba
...@@ -31,18 +31,13 @@ def xtime(): ...@@ -31,18 +31,13 @@ def xtime():
time.time = xtime time.time = xtime
def _precommit(user, description, extension): def commit(user, description, extension):
txn = transaction.get() txn = transaction.get()
txn.user = user txn.user = user
txn.description = description txn.description = description
txn.extension = extension txn.extension = extension
def commit(user, description, extension):
_precommit(user, description, extension)
txn = transaction.get()
txn.commit() txn.commit()
class Object(Persistent): class Object(Persistent):
# .value # .value
def __init__(self, value): def __init__(self, value):
...@@ -83,9 +78,9 @@ def main(): ...@@ -83,9 +78,9 @@ def main():
# undo a transaction one step before a latest one a couple of times # undo a transaction one step before a latest one a couple of times
for j in range(2): for j in range(2):
ul = db.undoLog(1+j, 2+j)[0] ul = db.undoLog(1, 2)[0]
_precommit(u"root%i.%i" % (i, j), u"undo %i.%i" % (i, j), {"x-generator": "zodb/py2 (undo %s)" % ul["id"]})
db.undo(ul["id"]) db.undo(ul["id"])
commit(u"root%i.%i" % (i, j), u"undo %i.%i" % (i, j), {"x-generator": "zodb/py2 (undo %s)" % ul["id"]})
conn.close() conn.close()
db.close() db.close()
......
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment