Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
ZODB
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kirill Smelkov
ZODB
Commits
2e618202
Commit
2e618202
authored
Jan 31, 2010
by
Jim Fulton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added undo support
parent
0b549c3f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
7 deletions
+11
-7
src/ZEO/CommitLog.py
src/ZEO/CommitLog.py
+11
-7
No files found.
src/ZEO/CommitLog.py
View file @
2e618202
...
...
@@ -32,27 +32,31 @@ class CommitLog:
self
.
pickler
=
cPickle
.
Pickler
(
self
.
file
,
1
)
self
.
pickler
.
fast
=
1
self
.
stores
=
0
self
.
read
=
0
def
size
(
self
):
return
self
.
file
.
tell
()
def
delete
(
self
,
oid
,
serial
):
self
.
pickler
.
dump
((
'
d'
,
oid
,
serial
))
self
.
pickler
.
dump
((
'
_delete'
,
(
oid
,
serial
)
))
self
.
stores
+=
1
def
store
(
self
,
oid
,
serial
,
data
):
self
.
pickler
.
dump
((
'
s'
,
oid
,
serial
,
data
))
self
.
pickler
.
dump
((
'
_store'
,
(
oid
,
serial
,
data
)
))
self
.
stores
+=
1
def
restore
(
self
,
oid
,
serial
,
data
,
prev_txn
):
self
.
pickler
.
dump
((
'
r'
,
oid
,
serial
,
data
,
prev_txn
))
self
.
pickler
.
dump
((
'
_restore'
,
(
oid
,
serial
,
data
,
prev_txn
)
))
self
.
stores
+=
1
def
get_loader
(
self
):
self
.
read
=
1
def
undo
(
self
,
transaction_id
):
self
.
pickler
.
dump
((
'_undo'
,
(
transaction_id
,
)))
self
.
stores
+=
1
def
__iter__
(
self
):
self
.
file
.
seek
(
0
)
return
self
.
stores
,
cPickle
.
Unpickler
(
self
.
file
)
unpickler
=
cPickle
.
Unpickler
(
self
.
file
)
for
i
in
range
(
self
.
stores
):
yield
unpickler
.
load
()
def
close
(
self
):
if
self
.
file
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment